TestFun/dogernout | TestFun/OG | ||||
---|---|---|---|---|---|
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 | ||||
n | 6 | def __call__(self, suite, allowed=[]): | n | 6 | def __call__(self, suit, allowed=[]): |
7 | flag = 0 | 7 | res = 0 | ||
8 | for i in suite: | 8 | for a in suit: | ||
9 | try: | 9 | try: | ||
n | 10 | self.fun(*i) | n | 10 | self.fun(*a) |
11 | except Exception as exp: | 11 | except Exception as E: | ||
12 | if type(exp) in allowed or Exception in allowed: | 12 | if type(E) in allowed or Exception in allowed: | ||
13 | flag = -1 | 13 | res = -1 | ||
14 | else: | 14 | else: | ||
15 | return 1 | 15 | return 1 | ||
t | 16 | return flag | t | 16 | return res |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|