~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_version_info.py

  • Committer: John Arbash Meinel
  • Date: 2009-10-12 18:14:21 UTC
  • mto: This revision was merged to the branch mainline in revision 4736.
  • Revision ID: john@arbash-meinel.com-20091012181421-6s3yxopo9s40wqjr
NEWS entry for StaticTuple class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
from bzrlib import (
25
25
    errors,
26
 
    registry,
27
26
    symbol_versioning,
28
27
    tests,
29
28
    version_info_formats,
326
325
 
327
326
    def setUp(self):
328
327
        super(TestVersionInfoFormatRegistry, self).setUp()
329
 
        self.overrideAttr(version_info_formats,
330
 
                          'format_registry', registry.Registry())
 
328
        registry = version_info_formats.format_registry
 
329
        self._default_key = registry._default_key
 
330
        self._dict = registry._dict.copy()
 
331
        self._help_dict = registry._help_dict.copy()
 
332
        self._info_dict = registry._info_dict.copy()
 
333
        self.addCleanup(self._cleanup)
 
334
 
 
335
    def _cleanup(self):
 
336
        # Restore the registry to pristine state after the test runs
 
337
        registry = version_info_formats.format_registry
 
338
        registry._default_key = self._default_key
 
339
        registry._dict = self._dict
 
340
        registry._help_dict = self._help_dict
 
341
        registry._info_dict = self._info_dict
331
342
 
332
343
    def test_register_remove(self):
333
344
        registry = version_info_formats.format_registry