Подлужный Олег 304 КФ TestFun 6633
Татьяна Точаева, 321 группа TestFun 8077
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        has_allowed = Falsen7        allowed_flag = False
8        has_not_allowed = False8        bad_flag = False
9        for args in suite:9        for args_tuple in suite:
10            try:10            try:
n11                self.fun(*args)n11                self.fun(*args_tuple)
12            except Exception as e:12            except Exception as e:
n13                if any((isinstance(e, exc) for exc in allowed)):n13                if any((isinstance(e, exc_class) for exc_class in allowe
 >d)):
14                    has_allowed = True14                    allowed_flag = True
15                else:15                else:
n16                    has_not_allowed = Truen16                    bad_flag = True
17        if has_not_allowed:17        if bad_flag:
18            return 118            return 1
t19        elif has_allowed:t19        elif allowed_flag:
20            return -120            return -1
21        else:21        else:
22            return 022            return 0
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op