~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_non_ascii.py

  • Committer: Vincent Ladeuil
  • Date: 2010-01-26 10:17:22 UTC
  • mfrom: (4985.1.5 add-attr-cleanup)
  • mto: This revision was merged to the branch mainline in revision 4988.
  • Revision ID: v.ladeuil+lp@free.fr-20100126101722-y213sv39buw3dgi2
Implement TestCase.overrideAttr to simplify tests setUp/cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        super(TestNonAscii, self).setUp()
41
41
        self._check_can_encode_paths()
42
42
 
43
 
        self.addCleanup(setattr, osutils, "_cached_user_encoding",
44
 
            osutils._cached_user_encoding)
45
 
        osutils._cached_user_encoding = self.encoding
 
43
        self.overrideAttr(osutils, '_cached_user_encoding', self.encoding)
46
44
        email = self.info['committer'] + ' <joe@foo.com>'
47
45
        os.environ['BZR_EMAIL'] = email.encode(osutils.get_user_encoding())
48
46
        self.create_base()