Rev 4969: (robertc) Show parameterised test ids when displaying details of test in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Sun Jan 17 22:21:09 GMT 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4969 [merge]
revision-id: pqm at pqm.ubuntu.com-20100117222107-b76bj4n2gcnofe9p
parent: pqm at pqm.ubuntu.com-20100117154132-qbzk6gfvh67ysrq9
parent: robertc at robertcollins.net-20100117214839-8erq0z49jtnfnxv7
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sun 2010-01-17 22:21:07 +0000
message:
  (robertc) Show parameterised test ids when displaying details of test
  	failures. (Robert Collins)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/test_selftest.py  test_selftest.py-20051202044319-c110a115d8c0456a
=== modified file 'NEWS'
--- a/NEWS	2010-01-17 15:07:39 +0000
+++ b/NEWS	2010-01-17 20:06:41 +0000
@@ -612,6 +612,9 @@
 * ``--parallel=fork`` is now compatible with --subunit.
   (Robert Collins, Vincent Ladeuil, #419776)
 
+* Reporting of failures shows test ids not descriptions and thus shows
+  parameterised tests correctly. (Robert Collins)
+
 * TestNotApplicable is now handled within the TestCase.run method rather
   than being looked for within ``ExtendedTestResult.addError``. This
   provides better handling with other ``TestResult`` objects, degrading to

=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2010-01-08 17:28:25 +0000
+++ b/bzrlib/tests/__init__.py	2010-01-17 20:06:41 +0000
@@ -237,6 +237,9 @@
                 '%d non-main threads were left active in the end.\n'
                 % (TestCase._active_threads - 1))
 
+    def getDescription(self, test):
+        return test.id()
+
     def _extractBenchmarkTime(self, testCase, details=None):
         """Add a benchmark time for the current test case."""
         if details and 'benchtime' in details:

=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py	2010-01-08 03:35:09 +0000
+++ b/bzrlib/tests/test_selftest.py	2010-01-17 21:48:39 +0000
@@ -1057,7 +1057,7 @@
             '(?sm)^bzr selftest.*$'
             '.*'
             '^======================================================================\n'
-            '^FAIL: unittest.FunctionTestCase \\(failing_test\\)\n'
+            '^FAIL: failing_test\n'
             '^----------------------------------------------------------------------\n'
             'Traceback \\(most recent call last\\):\n'
             '  .*' # File .*, line .*, in failing_test' - but maybe not from .pyc




More information about the bazaar-commits mailing list