~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_win32utils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-01-26 10:49:57 UTC
  • mfrom: (4987.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100126104957-dmtqnc0pckuruyla
(vila,
        jam) Implement TestCase.overrideAttr to simplify tests setUp/cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
266
266
        super(TestLocationsPywin32, self).setUp()
267
267
        # We perform the exact same tests after disabling the use of ctypes.
268
268
        # This causes the implementation to fall back to pywin32.
269
 
        self.old_ctypes = win32utils.has_ctypes
270
 
        win32utils.has_ctypes = False
271
 
        self.addCleanup(self.restoreCtypes)
272
 
 
273
 
    def restoreCtypes(self):
274
 
        win32utils.has_ctypes = self.old_ctypes
 
269
        self.overrideAttr(win32utils, 'has_ctypes', False)
 
270
        # FIXME: this should be done by parametrization -- vila 100123
275
271
 
276
272
 
277
273
class TestSetHidden(TestCaseInTempDir):