public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/, pmstestsuite/output/
Date: Tue,  3 Jan 2012 17:50:02 +0000 (UTC)	[thread overview]
Message-ID: <395b59ef8051775eeaa3518cf2928ffd9d2cf92e.mgorny@gentoo> (raw)

commit:     395b59ef8051775eeaa3518cf2928ffd9d2cf92e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  3 16:43:27 2012 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jan  3 16:43:27 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=395b59ef

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 <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()



             reply	other threads:[~2012-01-03 17:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-03 17:50 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-05 19:54 [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/, pmstestsuite/output/ Michał Górny
2011-08-05 17:09 Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=395b59ef8051775eeaa3518cf2928ffd9d2cf92e.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox