~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

Merge from bzr.dev, resolving conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
755
755
        self._benchcalls = []
756
756
        self._benchtime = None
757
757
        # prevent hooks affecting tests
758
 
        self._preserved_hooks = bzrlib.branch.Branch.hooks
 
758
        self._preserved_hooks = {
 
759
            bzrlib.branch.Branch:bzrlib.branch.Branch.hooks,
 
760
            bzrlib.smart.server.SmartTCPServer:bzrlib.smart.server.SmartTCPServer.hooks,
 
761
            }
759
762
        self.addCleanup(self._restoreHooks)
760
763
        # this list of hooks must be kept in sync with the defaults
761
764
        # in branch.py
1098
1101
            osutils.set_or_unset_env(name, value)
1099
1102
 
1100
1103
    def _restoreHooks(self):
1101
 
        bzrlib.branch.Branch.hooks = self._preserved_hooks
 
1104
        for klass, hooks in self._preserved_hooks.items():
 
1105
            setattr(klass, 'hooks', hooks)
1102
1106
 
1103
1107
    def knownFailure(self, reason):
1104
1108
        """This test has failed for some known reason."""