~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

Implement RemoteRepository.lock_write/unlock to expect and send tokens over the
smart protocol as appropriate, so that locking operations on RemoteRepositories
work correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1249
1249
                    this_tree=wt_to)
1250
1250
        wt_to.add_parent_tree_id(branch_from.last_revision())
1251
1251
 
 
1252
    def reduceLockdirTimeout(self):
 
1253
        """Reduce the default lock timeout for the duration of the test, so that
 
1254
        if LockContention occurs during a test, it does so quickly.
 
1255
 
 
1256
        Tests that expect to provoke LockContention errors should call this.
 
1257
        """
 
1258
        orig_timeout = bzrlib.lockdir._DEFAULT_TIMEOUT_SECONDS
 
1259
        def resetTimeout():
 
1260
            bzrlib.lockdir._DEFAULT_TIMEOUT_SECONDS = orig_timeout
 
1261
        self.addCleanup(resetTimeout)
 
1262
        bzrlib.lockdir._DEFAULT_TIMEOUT_SECONDS = 0
1252
1263
 
1253
1264
BzrTestBase = TestCase
1254
1265