Пузакова Полина СФ TestFun 6731
Саргсян Тачат 321 TestFun 6702
f1class Tester:f1class Tester:
22
3    def __init__(self, fun):3    def __init__(self, fun):
4        self.fun = fun4        self.fun = fun
55
6    def __call__(self, suite, allowed=()):6    def __call__(self, suite, allowed=()):
n7        al_ex = tuple(allowed)n7        allowed_exceptions = tuple(allowed)
8        has_allowed_exceptions = False
8        unallowed_ex_fl = False9        has_unallowed_exceptions = False
9        al_ex_fl = False
10        for i in suite:10        for params in suite:
11            try:11            try:
n12                self.fun(*i)n12                self.fun(*params)
13            except al_ex:13            except allowed_exceptions:
14                al_ex_fl = True14                has_allowed_exceptions = True
15            except Exception:15            except Exception:
n16                unallowed_ex_fl = Truen16                has_unallowed_exceptions = True
17            else:
18                continue
19        if unallowed_ex_fl:17        if has_unallowed_exceptions:
20            return 118            return 1
t21        elif al_ex_fl:t19        elif has_allowed_exceptions:
22            return -120            return -1
23        else:21        else:
24            return 022            return 0
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op