Rev 4746: (lifeless) Update the test suite API usage to use stopTestRun if done is not present. (Robert Collins) in file:///home/pqm/archives/thelove/bzr/2.0/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Apr 29 01:42:33 BST 2010


At file:///home/pqm/archives/thelove/bzr/2.0/

------------------------------------------------------------
revno: 4746 [merge]
revision-id: pqm at pqm.ubuntu.com-20100429004222-7l54pqjnaeer9gyr
parent: pqm at pqm.ubuntu.com-20100402135506-0tbjujqpqa0bxz7c
parent: robertc at robertcollins.net-20100428205847-cyvjntfifzvto07c
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.0
timestamp: Thu 2010-04-29 01:42:22 +0100
message:
  (lifeless) Update the test suite API usage to use stopTestRun if done is not present. (Robert Collins)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
=== modified file 'NEWS'
--- a/NEWS	2010-04-01 14:10:47 +0000
+++ b/NEWS	2010-04-28 20:58:47 +0000
@@ -26,6 +26,11 @@
   history no longer crash when deleted files are involved.
   (Vincent Ladeuil, John Arbash Meinel, #375898)
 
+* Selftest with versions of subunit that support ``stopTestRun`` will no longer
+  error. This error was caused by 2.0 not being updated when upstream
+  python merged the end of run patch, which chose ``stopTestRun`` rather than
+  ``done``. (Robert Collins, #571437)
+
 bzr 2.0.5
 #########
 

=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2010-03-18 05:49:26 +0000
+++ b/bzrlib/tests/__init__.py	2010-04-28 20:58:47 +0000
@@ -191,6 +191,8 @@
                 '%s is leaking threads among %d leaking tests.\n' % (
                 TestCase._first_thread_leaker_id,
                 TestCase._leaking_threads_tests))
+    # When merging to 2.1 this should conflict - take the 2.1 fix.
+    stopTestRun = done
 
     def _extractBenchmarkTime(self, testCase):
         """Add a benchmark time for the current test case."""
@@ -425,6 +427,8 @@
         # called when the tests that are going to run have run
         self.pb.clear()
         super(TextTestResult, self).done()
+    # When merging to 2.1 this should conflict - take the 2.1 fix.
+    stopTestRun = done
 
     def finished(self):
         self.pb.finished()
@@ -2812,7 +2816,8 @@
     result = runner.run(suite)
     if list_only:
         return True
-    result.done()
+    done = getattr(result, 'done', getattr(result, 'stopTestRun', None))
+    done()
     if strict:
         return result.wasStrictlySuccessful()
     else:




More information about the bazaar-commits mailing list