Rev 2429: (John Arbash Meinel) Simple test cleanup for win32 in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Thu Apr 19 21:30:16 BST 2007
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 2429
revision-id: pqm at pqm.ubuntu.com-20070419203013-exud3vftmox30imx
parent: pqm at pqm.ubuntu.com-20070419095256-nq0n6puj11zm7n7r
parent: john at arbash-meinel.com-20070419182756-rdg6e8zoaxy9mg9q
committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2007-04-19 21:30:13 +0100
message:
(John Arbash Meinel) Simple test cleanup for win32
modified:
bzrlib/tests/test_dirstate.py test_dirstate.py-20060728012006-d6mvoihjb3je9peu-2
------------------------------------------------------------
revno: 2425.3.1
merged: john at arbash-meinel.com-20070419182756-rdg6e8zoaxy9mg9q
parent: pqm at pqm.ubuntu.com-20070417080415-5vn25svmf95ki88z
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: dirstate_locking_fixes
timestamp: Thu 2007-04-19 13:27:56 -0500
message:
Change the DirState.test_initialize test so that we don't try to read a locked file.
=== modified file 'bzrlib/tests/test_dirstate.py'
--- a/bzrlib/tests/test_dirstate.py 2007-03-26 08:16:45 +0000
+++ b/bzrlib/tests/test_dirstate.py 2007-04-19 18:27:56 +0000
@@ -173,7 +173,7 @@
state.save()
finally:
state.unlock()
- del state # Callers should unlock
+ del state
state = dirstate.DirState.on_file('dirstate')
state.lock_read()
try:
@@ -648,12 +648,14 @@
try:
self.assertIsInstance(state, dirstate.DirState)
lines = state.get_lines()
- self.assertFileEqual(''.join(state.get_lines()),
- 'dirstate')
- self.check_state_with_reopen(expected_result, state)
- except:
+ finally:
state.unlock()
- raise
+ # On win32 you can't read from a locked file, even within the same
+ # process. So we have to unlock and release before we check the file
+ # contents.
+ self.assertFileEqual(''.join(lines), 'dirstate')
+ state.lock_read() # check_state_with_reopen will unlock
+ self.check_state_with_reopen(expected_result, state)
class TestDirStateManipulations(TestCaseWithDirState):
More information about the bazaar-commits
mailing list