squizyCake TestFun 6252
Кирилл Иванович Архипов 524 TestFun 8017
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        had_allowed_exception = False7        had_allowed_exception = False
n8        for test_case in suite:n8        for args in suite:
9            try:9            try:
t10                self.fun(*test_case)t10                self.fun(*args)
11            except Exception as e:11            except Exception as e:
12                if allowed and isinstance(e, tuple(allowed)):12                if allowed and isinstance(e, tuple(allowed)):
13                    had_allowed_exception = True13                    had_allowed_exception = True
14                else:14                else:
15                    return 115                    return 1
16        if had_allowed_exception:16        if had_allowed_exception:
17            return -117            return -1
18        return 018        return 0
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op