TestFun/bucholga | TestFun/soapun | ||||
---|---|---|---|---|---|
f | 1 | class Tester: | f | 1 | class Tester: |
2 | 2 | ||||
n | 3 | def __init__(self, func): | n | 3 | def __init__(self, fun): |
4 | self.func = func | 4 | self.fun = fun | ||
5 | 5 | ||||
6 | def __call__(self, suite, allowed=[]): | 6 | def __call__(self, suite, allowed=[]): | ||
n | 7 | res = 0 | n | 7 | result = 0 |
8 | for item in suite: | 8 | for s in suite: | ||
9 | try: | 9 | try: | ||
n | 10 | self.func(*item) | n | 10 | self.fun(*s) |
11 | except tuple(allowed): | 11 | except tuple(allowed) as e: | ||
12 | res = -1 | 12 | result = -1 | ||
13 | except: | 13 | except: | ||
t | 14 | res = 1 | t | 14 | result = 1 |
15 | return res | 15 | return result |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|