Лукьянов Артём Васильевич, 317, Севастопольский филилал TestFun 6800
ivio05 TestFun 6988
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=None):6    def __call__(self, suite, allowed=None):
7        if allowed is None:7        if allowed is None:
8            allowed = []8            allowed = []
n9        has_allowed = Falsen9        has_allowed_exception = False
10        for args in suite:10        for args in suite:
11            try:11            try:
12                self.fun(*args)12                self.fun(*args)
13            except Exception as e:13            except Exception as e:
14                if any((isinstance(e, exc) for exc in allowed)):14                if any((isinstance(e, exc) for exc in allowed)):
n15                    has_allowed = Truen15                    has_allowed_exception = True
16                else:16                else:
17                    return 117                    return 1
t18        return -1 if has_allowed else 0t18        return -1 if has_allowed_exception else 0
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op