~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
751
751
        self._startLogFile()
752
752
        self._benchcalls = []
753
753
        self._benchtime = None
 
754
        self._clear_hooks()
 
755
 
 
756
    def _clear_hooks(self):
754
757
        # prevent hooks affecting tests
 
758
        import bzrlib.branch
 
759
        import bzrlib.smart.server
755
760
        self._preserved_hooks = {
756
 
            bzrlib.branch.Branch:bzrlib.branch.Branch.hooks,
757
 
            bzrlib.smart.server.SmartTCPServer:bzrlib.smart.server.SmartTCPServer.hooks,
 
761
            bzrlib.branch.Branch: bzrlib.branch.Branch.hooks,
 
762
            bzrlib.smart.server.SmartTCPServer: bzrlib.smart.server.SmartTCPServer.hooks,
758
763
            }
759
764
        self.addCleanup(self._restoreHooks)
760
765
        # this list of hooks must be kept in sync with the defaults
761
766
        # in branch.py
762
767
        bzrlib.branch.Branch.hooks = bzrlib.branch.BranchHooks()
 
768
        bzrlib.smart.server.SmartTCPServer.hooks = \
 
769
            bzrlib.smart.server.SmartServerHooks()
763
770
 
764
771
    def _silenceUI(self):
765
772
        """Turn off UI for duration of test"""
2166
2173
                   'bzrlib.tests.test_gpg',
2167
2174
                   'bzrlib.tests.test_graph',
2168
2175
                   'bzrlib.tests.test_hashcache',
 
2176
                   'bzrlib.tests.test_help',
2169
2177
                   'bzrlib.tests.test_http',
2170
2178
                   'bzrlib.tests.test_http_response',
2171
2179
                   'bzrlib.tests.test_https_ca_bundle',
2196
2204
                   'bzrlib.tests.test_progress',
2197
2205
                   'bzrlib.tests.test_reconcile',
2198
2206
                   'bzrlib.tests.test_registry',
 
2207
                   'bzrlib.tests.test_remote',
2199
2208
                   'bzrlib.tests.test_repository',
2200
2209
                   'bzrlib.tests.test_revert',
2201
2210
                   'bzrlib.tests.test_revision',
2206
2215
                   'bzrlib.tests.test_selftest',
2207
2216
                   'bzrlib.tests.test_setup',
2208
2217
                   'bzrlib.tests.test_sftp_transport',
 
2218
                   'bzrlib.tests.test_smart',
2209
2219
                   'bzrlib.tests.test_smart_add',
2210
2220
                   'bzrlib.tests.test_smart_transport',
2211
2221
                   'bzrlib.tests.test_source',
2293
2303
        if sys.platform == 'win32' and e.errno == errno.EACCES:
2294
2304
            print >>sys.stderr, ('Permission denied: '
2295
2305
                                 'unable to remove testing dir '
2296
 
                                 '%s' % os.path.basename(test_root))
 
2306
                                 '%s' % os.path.basename(dirname))
2297
2307
        else:
2298
2308
            raise
2299
2309
 
2306
2316
    :param  quiet:  suppress report about deleting directories
2307
2317
    """
2308
2318
    import re
2309
 
    import shutil
2310
 
 
2311
2319
    re_dir = re.compile(r'''test\d\d\d\d\.tmp''')
2312
2320
    if root is None:
2313
2321
        root = u'.'