Алмаз Сейтхазин (КФ МГУ, кафедра НДС) TestFun 7237
Антипова Алёна 425 гр. TestFun 6419
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        allowed_exceptions = tuple(allowed)n7        allowed = tuple(allowed)
8        had_allowed_exception = False8        flag = False
9        for args in suite:9        for args in suite:
10            try:10            try:
11                self.fun(*args)11                self.fun(*args)
n12            except allowed_exceptions:n12            except allowed:
13                had_allowed_exception = True13                flag = True
14            except Exception:14            except Exception:
15                return 115                return 1
t16        return -1 if had_allowed_exception else 0t16        return -1 if flag else 0
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op