| TestFun/ilyagerelyuk | TestFun/mvpwn | ||||
|---|---|---|---|---|---|
| f | 1 | class Tester: | f | 1 | class Tester: |
| 2 | 2 | ||||
| n | 3 | def __init__(self, fun): | n | 3 | def __init__(self, f): |
| 4 | self.fun = fun | 4 | self.fun = f | ||
| 5 | 5 | ||||
| 6 | def __call__(self, suite, allowed=[]): | 6 | def __call__(self, suite, allowed=[]): | ||
| 7 | res = 0 | 7 | res = 0 | ||
| n | 8 | for par in suite: | n | 8 | for arg in suite: |
| 9 | try: | 9 | try: | ||
| t | 10 | self.fun(*par) | t | 10 | self.fun(*arg) |
| 11 | except Exception as e: | 11 | except Exception as E: | ||
| 12 | if type(e) in allowed or Exception in allowed: | 12 | if type(E) in allowed or Exception in allowed: | ||
| 13 | res = -1 | 13 | res = -1 | ||
| 14 | else: | 14 | else: | ||
| 15 | res = 1 | 15 | res = 1 | ||
| 16 | break | 16 | break | ||
| 17 | return res | 17 | return res | ||
| Legends | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||