1 |
commit: 55328c06b0cbf80cc923f52090de7e4deec43c75 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Aug 2 18:54:12 2011 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Aug 2 18:54:12 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=55328c06 |
7 |
|
8 |
Dump assertion results when tests fail. |
9 |
|
10 |
--- |
11 |
pmstestsuite/cli.py | 10 +++------- |
12 |
1 files changed, 3 insertions(+), 7 deletions(-) |
13 |
|
14 |
diff --git a/pmstestsuite/cli.py b/pmstestsuite/cli.py |
15 |
index 892b8ab..42ca98d 100644 |
16 |
--- a/pmstestsuite/cli.py |
17 |
+++ b/pmstestsuite/cli.py |
18 |
@@ -121,13 +121,11 @@ class PMSTestSuiteCLI(object): |
19 |
def tests_done(self): |
20 |
print('-> Checking test results...') |
21 |
self.failed = [] |
22 |
- self.asserts = [] # temporary |
23 |
for t in self.test_library: |
24 |
try: |
25 |
res = t.check_result(self.pm) |
26 |
except AssertionError as e: |
27 |
res = False |
28 |
- self.asserts.append(str(e)) |
29 |
else: |
30 |
# forward compat |
31 |
if res is None: |
32 |
@@ -151,11 +149,9 @@ class PMSTestSuiteCLI(object): |
33 |
len(self.test_library), len(self.failed))) |
34 |
for t in self.failed: |
35 |
print('- %s' % t) |
36 |
- |
37 |
- if self.asserts: |
38 |
- print('[DEBUG] asserts:') |
39 |
- for a in self.asserts: |
40 |
- print('- %s' % a) |
41 |
+ for a in t.assertions: |
42 |
+ print '-> %s: %s [%s]' % (a.name, str(a), |
43 |
+ 'OK' if a else 'FAILED') |
44 |
|
45 |
self.ret = 0 if not self.failed else 1 |
46 |
self.loop.quit() |