adhanin TestFun 6468
mannanovairat TestFun 6828
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        had_allowed = Falsen7        has_allowed_error = 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:
12                if any((isinstance(e, a) for a in allowed)):12                if any((isinstance(e, a) for a in allowed)):
n13                    had_allowed = Truen13                    has_allowed_error = True
14                else:14                else:
15                    return 115                    return 1
t16        return -1 if had_allowed else 0t16        return -1 if has_allowed_error else 0
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op