aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2012-01-03 17:43:27 +0100
committerMichał Górny <mgorny@gentoo.org>2012-01-03 17:43:27 +0100
commit395b59ef8051775eeaa3518cf2928ffd9d2cf92e (patch)
tree0edd892f9799a74e28fa10fe1978f8dc71e3aec1 /pmstestsuite
parentFix inherits in test cases. (diff)
downloadpms-test-suite-395b59ef8051775eeaa3518cf2928ffd9d2cf92e.tar.gz
pms-test-suite-395b59ef8051775eeaa3518cf2928ffd9d2cf92e.tar.bz2
pms-test-suite-395b59ef8051775eeaa3518cf2928ffd9d2cf92e.zip
Reraise test case exceptions neatly.
Diffstat (limited to 'pmstestsuite')
-rw-r--r--pmstestsuite/cli.py4
-rw-r--r--pmstestsuite/output/__init__.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/pmstestsuite/cli.py b/pmstestsuite/cli.py
index ac8dd2e..a0abf02 100644
--- a/pmstestsuite/cli.py
+++ b/pmstestsuite/cli.py
@@ -198,7 +198,9 @@ class PMSTestSuiteCLI(object):
outc = '.'
elif tr.exception:
outc = 'E'
- raise tr.exception
+ self.exception = tr.exception
+ self.loop.quit()
+ return
else:
outc = 'F'
print(outc, end='')
diff --git a/pmstestsuite/output/__init__.py b/pmstestsuite/output/__init__.py
index 341fcd8..fcfd27e 100644
--- a/pmstestsuite/output/__init__.py
+++ b/pmstestsuite/output/__init__.py
@@ -2,6 +2,8 @@
# (c) 2011 Michał Górny <mgorny@gentoo.org>
# Released under the terms of the 2-clause BSD license.
+from traceback import format_exc
+
from gentoopm.util import ABCObject, BoolCompat
from abc import abstractmethod, abstractproperty
@@ -27,7 +29,7 @@ class TestResult(BoolCompat):
self._res = self._FAILURE
except Exception as e:
self._res = self._EXCEPT
- self._exc = e
+ self._exc = format_exc()
else:
self._res = self._SUCCESS
self._assert = t.pop_assertions()