Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/test/test_imp.py

    r2 r391  
    99
    1010    def verify_lock_state(self, expected):
    11         self.failUnlessEqual(imp.lock_held(), expected,
     11        self.assertEqual(imp.lock_held(), expected,
    1212                             "expected imp.lock_held() to be %r" % expected)
    1313    def testLock(self):
     
    4444
    4545    def test_source(self):
    46         import os
    47         imp.reload(os)
     46        # XXX (ncoghlan): It would be nice to use test_support.CleanImport
     47        # here, but that breaks because the os module registers some
     48        # handlers in copy_reg on import. Since CleanImport doesn't
     49        # revert that registration, the module is left in a broken
     50        # state after reversion. Reinitialising the module contents
     51        # and just reverting os.environ to its previous state is an OK
     52        # workaround
     53        with test_support.EnvironmentVarGuard():
     54            import os
     55            imp.reload(os)
    4856
    4957    def test_extension(self):
    50         import time
    51         imp.reload(time)
     58        with test_support.CleanImport('time'):
     59            import time
     60            imp.reload(time)
    5261
    5362    def test_builtin(self):
    54         import marshal
    55         imp.reload(marshal)
     63        with test_support.CleanImport('marshal'):
     64            import marshal
     65            imp.reload(marshal)
    5666
    5767
Note: See TracChangeset for help on using the changeset viewer.