From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qj72s-0002it-H6 for garchives@archives.gentoo.org; Tue, 19 Jul 2011 09:56:54 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 93E2821C292; Tue, 19 Jul 2011 09:56:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 678C621C292 for ; Tue, 19 Jul 2011 09:56:42 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D088B1B4011 for ; Tue, 19 Jul 2011 09:56:41 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 8E07580042 for ; Tue, 19 Jul 2011 09:56:40 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/tests/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/tests/__init__.py X-VCS-Directories: gentoopm/tests/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: ff335f908bfe971ee8961580e6933950c2ac3ef0 Date: Tue, 19 Jul 2011 09:56:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 12b8e659b4f653bd4bd21f29bd99f539 commit: ff335f908bfe971ee8961580e6933950c2ac3ef0 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Tue Jul 19 09:30:37 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Tue Jul 19 09:30:37 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoopm.git;= a=3Dcommit;h=3Dff335f90 Tests: prepend all exceptions with PM name. --- gentoopm/tests/__init__.py | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gentoopm/tests/__init__.py b/gentoopm/tests/__init__.py index fbb773f..807af17 100644 --- a/gentoopm/tests/__init__.py +++ b/gentoopm/tests/__init__.py @@ -21,8 +21,12 @@ class PMTestCase(unittest.TestCase): def _try(self, f, args): try: f(self, *args) - except AssertionError as e: - raise AssertionError('[%s] %s' % (self._pm.name, e.args[0])) + except Exception as e: + if isinstance(e.args[0], str): + raise e.__class__('[%s] %s' % (self._pm.name, e.args[0]), + *e.args[1:]) + else: + raise =20 def assertEqual(self, *args): self._try(unittest.TestCase.assertEqual, args)