| Максимова Яна Дмитриевна TestFun 6553 | Болл Алёна Лилиана Джоханна, 425 TestFun 6622 | ||||
|---|---|---|---|---|---|
| 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, suite, allowed=[]): |
| 7 | res = 0 | 7 | res = 0 | ||
| 8 | for args in suite: | 8 | for args in suite: | ||
| 9 | try: | 9 | try: | ||
| 10 | self.fun(*args) | 10 | self.fun(*args) | ||
| 11 | except Exception as exc: | 11 | except Exception as exc: | ||
| t | 12 | if any((isinstance(exc, exceptions) for exceptions in al | t | 12 | if any((isinstance(exc, elem) for elem in allowed)): |
| > | lowed)): | ||||
| 13 | res = -1 | 13 | res = -1 | ||
| 14 | else: | 14 | else: | ||
| 15 | return 1 | 15 | return 1 | ||
| 16 | return res | 16 | return res | ||
| Legends | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||