Омаров Микаил, 321 группа TestFun 6253
adhanin TestFun 6468
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        allowed_exceptions_occurred = Falsen7        had_allowed = False
8        for test_case in suite:8        for args in suite:
9            try:9            try:
n10                self.fun(*test_case)n10                self.fun(*args)
11            except Exception as e:11            except Exception as e:
n12                if any((isinstance(e, exc_type) for exc_type in allowed)n12                if any((isinstance(e, a) for a in allowed)):
>): 
13                    allowed_exceptions_occurred = True13                    had_allowed = True
14                else:14                else:
15                    return 115                    return 1
t16        return -1 if allowed_exceptions_occurred else 0t16        return -1 if had_allowed else 0
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op