f | class Tester: | f | class Tester: |
| | | |
n | def __init__(self, f): | n | def __init__(self, fun): |
| self.func = f | | self.fun = fun |
| | | |
n | def __call__(self, args, exc=[]): | n | def __call__(self, suite, allowed=[]): |
| allowedExc = False | | had_allowed_exceptions = False |
| for arg in args: | | for args in suite: |
| try: | | try: |
n | self.func(*arg) | n | self.fun(*args) |
| except tuple(exc) as e: | | except tuple(allowed) as E: |
| allowedExc = True | | had_allowed_exceptions = True |
| except Exception as e: | | except: |
| return 1 | | return 1 |
t | return -1 if allowedExc else 0 | t | return -1 if had_allowed_exceptions else 0 |