Тулебаев Адильхан, 416 группа TestFun 7130
Рогинко Алла 321гр TestFun 7332
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
n9        allowed_tuple = tuple(allowed) if allowed else ()n9        allowed_types = tuple(allowed) if allowed else ()
10        for params in suite:10        for params in suite:
11            try:11            try:
12                self.fun(*params)12                self.fun(*params)
13            except Exception as e:13            except Exception as e:
t14                if allowed_tuple and isinstance(e, allowed_tuple):t14                if allowed_types and isinstance(e, allowed_types):
15                    has_allowed_exceptions = True15                    has_allowed_exceptions = True
16                else:16                else:
17                    has_unallowed_exceptions = True17                    has_unallowed_exceptions = True
18        if has_unallowed_exceptions:18        if has_unallowed_exceptions:
19            return 119            return 1
20        elif has_allowed_exceptions:20        elif has_allowed_exceptions:
21            return -121            return -1
22        else:22        else:
23            return 023            return 0
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op