802
802
# prevent hooks affecting tests
804
805
import bzrlib.smart.server
805
806
self._preserved_hooks = {
806
807
bzrlib.branch.Branch: bzrlib.branch.Branch.hooks,
807
808
bzrlib.mutabletree.MutableTree: bzrlib.mutabletree.MutableTree.hooks,
808
810
bzrlib.smart.server.SmartTCPServer: bzrlib.smart.server.SmartTCPServer.hooks,
810
812
self.addCleanup(self._restoreHooks)
811
813
# reset all hooks to an empty instance of the appropriate type
812
814
bzrlib.branch.Branch.hooks = bzrlib.branch.BranchHooks()
813
816
bzrlib.smart.server.SmartTCPServer.hooks = bzrlib.smart.server.SmartServerHooks()