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