~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_locking.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for the (un)lock interfaces on all working tree implemenations."""
18
18
 
19
 
import bzrlib.branch as branch
20
 
import bzrlib.errors as errors
 
19
from bzrlib import (
 
20
    branch,
 
21
    errors,
 
22
    lockdir,
 
23
    )
21
24
from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
22
25
 
23
26
 
179
182
        branch_copy.lock_write()
180
183
        try:
181
184
            try:
182
 
                self.assertRaises(errors.LockError, wt.lock_write)
 
185
                orig_default = lockdir._DEFAULT_TIMEOUT_SECONDS
 
186
                try:
 
187
                    lockdir._DEFAULT_TIMEOUT_SECONDS = 1
 
188
                    self.assertRaises(errors.LockError, wt.lock_write)
 
189
                finally:
 
190
                    lockdir._DEFAULT_TIMEOUT_SECONDS = orig_default
 
191
 
183
192
                self.assertFalse(wt.is_locked())
184
193
                self.assertFalse(wt.branch.is_locked())
185
194
            finally:
198
207
        # locking, the test still passes.
199
208
        wt = self.make_branch_and_tree('.')
200
209
        branch_copy = branch.Branch.open('.')
 
210
 
201
211
        branch_copy.lock_write()
202
212
        try:
203
213
            try: