Сагдиев Айрат, 321 группа TestFun 11334
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=()):
7        had_allowed = False7        had_allowed = False
8        for args in suite:8        for args in suite:
9            try:9            try:
10                self.fun(*args)10                self.fun(*args)
11            except Exception as e:11            except Exception as e:
t12                if any((isinstance(e, exc) for exc in allowed)):t12                if any((isinstance(e, a) for a in allowed)):
13                    had_allowed = True13                    had_allowed = True
14                else:14                else:
15                    return 115                    return 1
16        return -1 if had_allowed else 016        return -1 if had_allowed else 0
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op