Rev 4536: Add a test that thisFailsStrictLockCheck() does the right thing. in lp:///~jameinel/bzr/1.18-lock-warnings
John Arbash Meinel
john at arbash-meinel.com
Fri Jul 31 17:25:00 BST 2009
At lp:///~jameinel/bzr/1.18-lock-warnings
------------------------------------------------------------
revno: 4536
revision-id: john at arbash-meinel.com-20090731162254-cnp93fq23p18uavb
parent: john at arbash-meinel.com-20090731161812-6dnu3sy885w1njzi
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 1.18-lock-warnings
timestamp: Fri 2009-07-31 11:22:54 -0500
message:
Add a test that thisFailsStrictLockCheck() does the right thing.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py 2009-07-31 16:18:12 +0000
+++ b/bzrlib/tests/test_selftest.py 2009-07-31 16:22:54 +0000
@@ -1459,6 +1459,19 @@
self.assertFalse(self.test_lock_check_thorough)
self.assertEqual(set(), self.flags)
+ def test_this_fails_strict_lock_check(self):
+ class TestThatRecordsFlags(tests.TestCase):
+ def test_foo(nested_self):
+ self.flags1 = set(bzrlib.debug.debug_flags)
+ self.thisFailsStrictLockCheck()
+ self.flags2 = set(bzrlib.debug.debug_flags)
+ # Make sure lock checking is active
+ self.change_selftest_debug_flags(set())
+ test = TestThatRecordsFlags('test_foo')
+ test.run(self.make_test_result())
+ self.assertEqual(set(['strict_locks']), self.flags1)
+ self.assertEqual(set(), self.flags2)
+
def test_debug_flags_restored(self):
"""The bzrlib debug flags should be restored to their original state
after the test was run, even if allow_debug is set.
More information about the bazaar-commits
mailing list