/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2008-12-12 20:06:28 UTC
  • mto: This revision was merged to the branch mainline in revision 3912.
  • Revision ID: john@arbash-meinel.com-20081212200628-xmm9i33jq3d6tsh3
Start moving things around so that the entry cache is passed in.

This has a negligible effect on performance, and means that we can have the
cache lifetime associated with a repository, rather than 'always on'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
771
771
        self._benchtime = None
772
772
        self._clear_hooks()
773
773
        self._clear_debug_flags()
774
 
        self._clear_caches()
775
774
        TestCase._active_threads = threading.activeCount()
776
775
        self.addCleanup(self._check_leaked_threads)
777
776
 
788
787
                # to a TestCase object.
789
788
                atexit.register(_report_leaked_threads)
790
789
 
791
 
    def _clear_caches(self):
792
 
        from bzrlib import xml5, xml6, xml7, xml8
793
 
        # Many tests re-use the same revision ids, so the entry caches are not
794
 
        # valid
795
 
        xml5.serializer_v5._entry_cache.clear()
796
 
        xml6.serializer_v6._entry_cache.clear()
797
 
        xml7.serializer_v7._entry_cache.clear()
798
 
        xml8.serializer_v8._entry_cache.clear()
799
 
 
800
790
    def _clear_debug_flags(self):
801
791
        """Prevent externally set debug flags affecting tests.
802
792