Revision d2e1b032 kamaki/clients/tests/__init__.py
b/kamaki/clients/tests/__init__.py | ||
---|---|---|
85 | 85 |
self, |
86 | 86 |
predicate=inspect.ismethod)\ |
87 | 87 |
if method[0].startswith('_test_')] |
88 |
exceptions = {}
|
|
88 |
failures = 0
|
|
89 | 89 |
for method in methods: |
90 | 90 |
stdout.write('Test %s' % method[0][6:]) |
91 | 91 |
try: |
... | ... | |
93 | 93 |
print(' ...ok') |
94 | 94 |
except AssertionError: |
95 | 95 |
print(' FAIL: %s (%s)' % (method[0], method[1])) |
96 |
exceptions[method[0]] = extract_stack() |
|
97 |
for m, e in exceptions.items(): |
|
98 |
print('==================\nFAIL: %s\n------------------' % m[6:]) |
|
99 |
for err in e[-30:]: |
|
100 |
print('%s %s %s %s' % err) |
|
101 |
if exceptions: |
|
102 |
raise AssertionError('(#of fails: %s)' % len(exceptions)) |
|
96 |
failures += 1 |
|
97 |
if failures: |
|
98 |
raise AssertionError('%s failures' % failures) |
|
103 | 99 |
|
104 | 100 |
|
105 | 101 |
def init_parser(): |
Also available in: Unified diff