~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Patch Queue Manager
  • Date: 2011-12-02 12:02:54 UTC
  • mfrom: (6015.42.8 test-server-races)
  • Revision ID: pqm@pqm.ubuntu.com-20111202120254-kccrfj6buuqt1iui
(vila) Properly synchronize connection thread start with test server main
 thread. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
    deprecated_in,
95
95
    )
96
96
from bzrlib.tests import (
 
97
    fixtures,
97
98
    test_server,
98
99
    TestUtil,
99
100
    treeshape,
995
996
 
996
997
    def setUp(self):
997
998
        super(TestCase, self).setUp()
 
999
 
 
1000
        timeout = config.GlobalStack().get('selftest.timeout')
 
1001
        if timeout:
 
1002
            timeout_fixture = fixtures.TimeoutFixture(timeout)
 
1003
            timeout_fixture.setUp()
 
1004
            self.addCleanup(timeout_fixture.cleanUp)
 
1005
 
998
1006
        for feature in getattr(self, '_test_needs_features', []):
999
1007
            self.requireFeature(feature)
1000
1008
        self._cleanEnvironment()
 
1009
 
1001
1010
        if bzrlib.global_state is not None:
1002
1011
            self.overrideAttr(bzrlib.global_state, 'cmdline_overrides',
1003
1012
                              config.CommandLineStore())
 
1013
 
1004
1014
        self._silenceUI()
1005
1015
        self._startLogFile()
1006
1016
        self._benchcalls = []
2370
2380
        from bzrlib.smart import request
2371
2381
        request_handlers = request.request_handlers
2372
2382
        orig_method = request_handlers.get(verb)
 
2383
        orig_info = request_handlers.get_info(verb)
2373
2384
        request_handlers.remove(verb)
2374
 
        self.addCleanup(request_handlers.register, verb, orig_method)
 
2385
        self.addCleanup(request_handlers.register, verb, orig_method,
 
2386
            info=orig_info)
2375
2387
 
2376
2388
 
2377
2389
class CapturedCall(object):