~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-03-26 00:36:17 UTC
  • mfrom: (3302.2.2 selftest-debug-flags)
  • Revision ID: pqm@pqm.ubuntu.com-20080326003617-r5xl8b8d6dqqor3w
Add -Dselftest_debug debug flag. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
811
811
        Tests that want to use debug flags can just set them in the
812
812
        debug_flags set during setup/teardown.
813
813
        """
814
 
        self._preserved_debug_flags = set(debug.debug_flags)
815
 
        debug.debug_flags.clear()
816
 
        self.addCleanup(self._restore_debug_flags)
 
814
        if 'selftest_debug' not in debug.debug_flags:
 
815
            self._preserved_debug_flags = set(debug.debug_flags)
 
816
            debug.debug_flags.clear()
 
817
            self.addCleanup(self._restore_debug_flags)
817
818
 
818
819
    def _clear_hooks(self):
819
820
        # prevent hooks affecting tests