TestFun/MVPakaGuru
TestFun/Beka00
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, errs=[]):n6    def __call__(self, suite, allowed=[]):
7        check = 07        position = 0
8        for s in suite:8        for sequence in suite:
9            try:9            try:
n10                self.fun(*s)n10                self.fun(*sequence)
11            except Exception as ex:11            except Exception as EXC:
12                check2 = 012                position2 = 0
13                for allowed_ex in errs:13                for err in allowed:
14                    if isinstance(ex, allowed_ex):14                    if isinstance(EXC, err):
15                        check2 = 115                        position2 = 1
16                if check2 == 1:16                if position2 == 1:
17                    check = max(1, check)17                    position = max(1, position)
18                else:18                else:
n19                    check = 2n19                    position = 2
20        if check == 2:20        if position == 2:
21            return 121            return 1
t22        if check == 1:t22        if position == 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