~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Alexander Belchenko
  • Date: 2007-02-02 09:14:30 UTC
  • mfrom: (2256 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2259.
  • Revision ID: bialix@ukr.net-20070202091430-vdgouvazded1yfqw
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
569
569
        self._startLogFile()
570
570
        self._benchcalls = []
571
571
        self._benchtime = None
 
572
        # prevent hooks affecting tests
 
573
        self._preserved_hooks = bzrlib.branch.Branch.hooks
 
574
        self.addCleanup(self._restoreHooks)
 
575
        # this list of hooks must be kept in sync with the defaults
 
576
        # in branch.py
 
577
        bzrlib.branch.Branch.hooks = bzrlib.branch.BranchHooks()
572
578
 
573
579
    def _silenceUI(self):
574
580
        """Turn off UI for duration of test"""
835
841
        for name, value in self.__old_env.iteritems():
836
842
            osutils.set_or_unset_env(name, value)
837
843
 
 
844
    def _restoreHooks(self):
 
845
        bzrlib.branch.Branch.hooks = self._preserved_hooks
 
846
 
838
847
    def tearDown(self):
839
848
        self._runCleanups()
840
849
        unittest.TestCase.tearDown(self)
1760
1769
                   'bzrlib.tests.test_config',
1761
1770
                   'bzrlib.tests.test_conflicts',
1762
1771
                   'bzrlib.tests.test_decorators',
 
1772
                   'bzrlib.tests.test_delta',
1763
1773
                   'bzrlib.tests.test_diff',
1764
1774
                   'bzrlib.tests.test_doc_generate',
1765
1775
                   'bzrlib.tests.test_errors',