Changeset 391 for python/trunk/Lib/test/test_imp.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/test/test_imp.py
r2 r391 9 9 10 10 def verify_lock_state(self, expected): 11 self. failUnlessEqual(imp.lock_held(), expected,11 self.assertEqual(imp.lock_held(), expected, 12 12 "expected imp.lock_held() to be %r" % expected) 13 13 def testLock(self): … … 44 44 45 45 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) 48 56 49 57 def test_extension(self): 50 import time 51 imp.reload(time) 58 with test_support.CleanImport('time'): 59 import time 60 imp.reload(time) 52 61 53 62 def test_builtin(self): 54 import marshal 55 imp.reload(marshal) 63 with test_support.CleanImport('marshal'): 64 import marshal 65 imp.reload(marshal) 56 66 57 67
Note:
See TracChangeset
for help on using the changeset viewer.