Aleksey TestFun 7151
Леонов Никита, 418 группа TestFun 6862
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        has_allowed_exceptions = False7        has_allowed_exceptions = False
8        has_unallowed_exceptions = False8        has_unallowed_exceptions = False
9        for params in suite:9        for params in suite:
10            try:10            try:
11                self.fun(*params)11                self.fun(*params)
12            except Exception as e:12            except Exception as e:
13                if any((isinstance(e, exc_type) for exc_type in allowed)13                if any((isinstance(e, exc_type) for exc_type in allowed)
>):>):
14                    has_allowed_exceptions = True14                    has_allowed_exceptions = True
15                else:15                else:
16                    has_unallowed_exceptions = True16                    has_unallowed_exceptions = True
t17            else:t17                    break
18                continue
19        if has_unallowed_exceptions:18        if has_unallowed_exceptions:
20            return 119            return 1
21        elif has_allowed_exceptions:20        elif has_allowed_exceptions:
22            return -121            return -1
23        else:22        else:
24            return 023            return 0
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op