summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/test
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2009-02-07 01:52:25 (GMT)
committerBrett Cannon <bcannon@gmail.com>2009-02-07 01:52:25 (GMT)
commit06c9d96b7033a70922851d7dfe23e74e73ddd287 (patch)
treef8e66db58a2fc1ed9508e45db64507a916130ab7 /Lib/importlib/test
parentd94e558fdc58d0a15545e858cc47eabe7ee7f38d (diff)
downloadcpython-06c9d96b7033a70922851d7dfe23e74e73ddd287.zip
cpython-06c9d96b7033a70922851d7dfe23e74e73ddd287.tar.gz
cpython-06c9d96b7033a70922851d7dfe23e74e73ddd287.tar.bz2
Move importlib completely over to using rpartition and accepting the empty
string for top-level modules.
Diffstat (limited to 'Lib/importlib/test')
-rw-r--r--Lib/importlib/test/extension/test_loader.py3
-rw-r--r--Lib/importlib/test/source/test_loader.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/Lib/importlib/test/extension/test_loader.py b/Lib/importlib/test/extension/test_loader.py
index 1e43fdd..01f3426 100644
--- a/Lib/importlib/test/extension/test_loader.py
+++ b/Lib/importlib/test/extension/test_loader.py
@@ -21,7 +21,8 @@ class LoaderTests(abc.LoaderTests):
with util.uncache(test_path_hook.NAME):
module = self.load_module(test_path_hook.NAME)
for attr, value in [('__name__', test_path_hook.NAME),
- ('__file__', test_path_hook.FILEPATH)]:
+ ('__file__', test_path_hook.FILEPATH),
+ ('__package__', '')]:
self.assertEqual(getattr(module, attr), value)
self.assert_(test_path_hook.NAME in sys.modules)
diff --git a/Lib/importlib/test/source/test_loader.py b/Lib/importlib/test/source/test_loader.py
index e333b85..4ca9af1 100644
--- a/Lib/importlib/test/source/test_loader.py
+++ b/Lib/importlib/test/source/test_loader.py
@@ -23,7 +23,7 @@ class SimpleTest(unittest.TestCase):
module = loader.load_module('_temp')
self.assert_('_temp' in sys.modules)
check = {'__name__': '_temp', '__file__': mapping['_temp'],
- '__package__': None}
+ '__package__': ''}
for attr, value in check.items():
self.assertEqual(getattr(module, attr), value)