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