From 395b59ef8051775eeaa3518cf2928ffd9d2cf92e Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Tue, 3 Jan 2012 17:43:27 +0100 Subject: Reraise test case exceptions neatly. --- pmstestsuite/cli.py | 4 +++- pmstestsuite/output/__init__.py | 4 +++- 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 # 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() -- cgit v1.2.3-65-gdbad