TestFun/Beka00
TestFun/MVPakaGuru
f1class Tester:f1class Tester:
22
3    def __init__(self, fun):3    def __init__(self, fun):
4        self.fun = fun4        self.fun = fun
55
n6    def __call__(self, suite, allowed=[]):n6    def __call__(self, suite, errs=[]):
7        position = 07        check = 0
8        for sequence in suite:8        for s in suite:
9            try:9            try:
n10                self.fun(*sequence)n10                self.fun(*s)
11            except Exception as EXC:11            except Exception as ex:
12                position2 = 012                check2 = 0
13                for err in allowed:13                for allowed_ex in errs:
14                    if isinstance(EXC, err):14                    if isinstance(exallowed_ex):
15                        position2 = 115                        check2 = 1
16                if position2 == 1:16                if check2 == 1:
17                    position = max(1, position)17                    check = max(1, check)
18                else:18                else:
n19                    position = 2n19                    check = 2
20        if position == 2:20        if check == 2:
21            return 121            return 1
t22        if position == 1:t22        if check == 1:
23            return -123            return -1
24        return 024        return 0
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op