[pitivi: 10/12] Fix tests/common.py so that I can use trial to run tests again.
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi: 10/12] Fix tests/common.py so that I can use trial to run tests again.
- Date: Sun, 7 Mar 2010 17:22:57 +0000 (UTC)
commit 3731a7a1c8332ce8fffc6c82fa8d57ccfe3294a1
Author: Alessandro Decina <alessandro d gmail com>
Date: Sun Mar 7 13:09:30 2010 +0100
Fix tests/common.py so that I can use trial to run tests again.
tests/common.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/tests/common.py b/tests/common.py
index 4294734..1598b0d 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -58,16 +58,16 @@ class TestCase(unittest.TestCase):
del self._tracked
def setUp(self):
- self._num_failures = len(self._result.failures)
- self._num_errors = len(self._result.errors)
+ self._num_failures = len(getattr(self._result, 'failures', []))
+ self._num_errors = len(getattr(self._result, 'errors', []))
if detect_leaks:
self.gctrack()
def tearDown(self):
# don't barf gc info all over the console if we have already failed a
# test case
- if ((self._num_failures < len(self._result.failures)) or
- (self._num_errors < len(self._result.errors))):
+ if (self._num_failures < len(getattr(self._result, 'failures', []))
+ or self._num_errors < len(getattr(self._result, 'failures', []))):
return
if detect_leaks:
self.gccollect()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]