[Python-checkins] r52264 - sandbox/trunk/import_in_py/test_importer.py
brett.cannon
python-checkins at python.org
Tue Oct 10 02:53:44 CEST 2006
Author: brett.cannon
Date: Tue Oct 10 02:53:43 2006
New Revision: 52264
Modified:
sandbox/trunk/import_in_py/test_importer.py
Log:
Add another test for the filesystem loader to make sure it loads from
sys.modules when it can.
Modified: sandbox/trunk/import_in_py/test_importer.py
==============================================================================
--- sandbox/trunk/import_in_py/test_importer.py (original)
+++ sandbox/trunk/import_in_py/test_importer.py Tue Oct 10 02:53:43 2006
@@ -176,6 +176,14 @@
new_module = self.loader.load_module(self.module)
self.verify_module(new_module)
+ def test_load_module_sys_modules(self):
+ # Make sure that the loader returns the module from sys.modules if it
+ # is there.
+ new_module = new.module(self.module)
+ sys.modules[self.module] = new_module
+ loaded_module = self.loader.load_module(self.module)
+ self.failUnless(loaded_module is new_module)
+
def test_main():
test_support.run_unittest(
More information about the Python-checkins
mailing list