s02220725 TestFun 6406
Алтухов Егор, 321 группа TestFun 6341
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_exception = Falsen7        fl = 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:
n12                had_exception = Truen12                fl = True
13                if not isinstance(e, tuple(allowed)):13                if not isinstance(e, tuple(allowed)):
14                    return 114                    return 1
t15        if had_exception:t15        if fl:
16            return -116            return -1
17        return 017        return 0
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op