1 |
commit: 395b59ef8051775eeaa3518cf2928ffd9d2cf92e |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 3 16:43:27 2012 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 3 16:43:27 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=395b59ef |
7 |
|
8 |
Reraise test case exceptions neatly. |
9 |
|
10 |
--- |
11 |
pmstestsuite/cli.py | 4 +++- |
12 |
pmstestsuite/output/__init__.py | 4 +++- |
13 |
2 files changed, 6 insertions(+), 2 deletions(-) |
14 |
|
15 |
diff --git a/pmstestsuite/cli.py b/pmstestsuite/cli.py |
16 |
index ac8dd2e..a0abf02 100644 |
17 |
--- a/pmstestsuite/cli.py |
18 |
+++ b/pmstestsuite/cli.py |
19 |
@@ -198,7 +198,9 @@ class PMSTestSuiteCLI(object): |
20 |
outc = '.' |
21 |
elif tr.exception: |
22 |
outc = 'E' |
23 |
- raise tr.exception |
24 |
+ self.exception = tr.exception |
25 |
+ self.loop.quit() |
26 |
+ return |
27 |
else: |
28 |
outc = 'F' |
29 |
print(outc, end='') |
30 |
|
31 |
diff --git a/pmstestsuite/output/__init__.py b/pmstestsuite/output/__init__.py |
32 |
index 341fcd8..fcfd27e 100644 |
33 |
--- a/pmstestsuite/output/__init__.py |
34 |
+++ b/pmstestsuite/output/__init__.py |
35 |
@@ -2,6 +2,8 @@ |
36 |
# (c) 2011 Michał Górny <mgorny@g.o> |
37 |
# Released under the terms of the 2-clause BSD license. |
38 |
|
39 |
+from traceback import format_exc |
40 |
+ |
41 |
from gentoopm.util import ABCObject, BoolCompat |
42 |
from abc import abstractmethod, abstractproperty |
43 |
|
44 |
@@ -27,7 +29,7 @@ class TestResult(BoolCompat): |
45 |
self._res = self._FAILURE |
46 |
except Exception as e: |
47 |
self._res = self._EXCEPT |
48 |
- self._exc = e |
49 |
+ self._exc = format_exc() |
50 |
else: |
51 |
self._res = self._SUCCESS |
52 |
self._assert = t.pop_assertions() |