Rev 5230: (lifeless) Make our selftest for dangling-lock detection in selftests more in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri May 14 09:28:00 BST 2010


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

------------------------------------------------------------
revno: 5230 [merge]
revision-id: pqm at pqm.ubuntu.com-20100514082757-jbg7ncvtca1bjdtu
parent: pqm at pqm.ubuntu.com-20100513185258-xtx26u4bsjyhat1n
parent: robertc at robertcollins.net-20100514065155-3i2woxe123650ib2
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2010-05-14 09:27:57 +0100
message:
  (lifeless) Make our selftest for dangling-lock detection in selftests more
   robust (fixes use with testtools 0.9.3). (Robert Collins)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/tests/test_selftest.py  test_selftest.py-20051202044319-c110a115d8c0456a
=== modified file 'NEWS'
--- a/NEWS	2010-05-13 18:52:58 +0000
+++ b/NEWS	2010-05-14 08:27:57 +0000
@@ -103,6 +103,11 @@
 * Reduce peak memory by one copy of compressed text.
   (John Arbash Meinel, #566940)
 
+* Selftest was failing with testtools 0.9.3, which caused an
+  AssertionError raised from a cleanUp to be reported as a Failure, not an
+  Error, breaking on of our test hygiene tests.
+  (Robert Collins, Vincent Ladeuil).
+
 * Show the filenames when a file rename fails so that the error will be
   more comprehensible.
   (Martin Pool, #491763)

=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py	2010-04-22 18:36:13 +0000
+++ b/bzrlib/tests/test_selftest.py	2010-05-14 06:51:55 +0000
@@ -609,12 +609,13 @@
                 l.attempt_lock()
         test = TestDanglingLock('test_function')
         result = test.run()
+        total_failures = result.errors + result.failures
         if self._lock_check_thorough:
-            self.assertEqual(1, len(result.errors))
+            self.assertLength(1, total_failures)
         else:
             # When _lock_check_thorough is disabled, then we don't trigger a
             # failure
-            self.assertEqual(0, len(result.errors))
+            self.assertLength(0, total_failures)
 
 
 class TestTestCaseWithTransport(tests.TestCaseWithTransport):




More information about the bazaar-commits mailing list