summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/test/frozen/test_loader.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2009-03-10 05:17:37 (GMT)
committerBrett Cannon <bcannon@gmail.com>2009-03-10 05:17:37 (GMT)
commit2cf03a820483babd243a48de47865585fa697235 (patch)
tree8f568016f9c3bdc2c6be744ce65057b48c100e91 /Lib/importlib/test/frozen/test_loader.py
parentd43b30b046ea151612494ed6d44aed3df71b480a (diff)
downloadcpython-2cf03a820483babd243a48de47865585fa697235.zip
cpython-2cf03a820483babd243a48de47865585fa697235.tar.gz
cpython-2cf03a820483babd243a48de47865585fa697235.tar.bz2
Implement importlib.util.set_loader: a decorator to automatically set
__loader__ on modules.
Diffstat (limited to 'Lib/importlib/test/frozen/test_loader.py')
-rw-r--r--Lib/importlib/test/frozen/test_loader.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/importlib/test/frozen/test_loader.py b/Lib/importlib/test/frozen/test_loader.py
index 9032b0b..54d805d 100644
--- a/Lib/importlib/test/frozen/test_loader.py
+++ b/Lib/importlib/test/frozen/test_loader.py
@@ -9,7 +9,7 @@ class LoaderTests(abc.LoaderTests):
with util.uncache('__hello__'):
module = machinery.FrozenImporter.load_module('__hello__')
check = {'__name__': '__hello__', '__file__': '<frozen>',
- '__package__': ''}
+ '__package__': '', '__loader__': machinery.FrozenImporter}
for attr, value in check.items():
self.assertEqual(getattr(module, attr), value)
@@ -17,7 +17,8 @@ class LoaderTests(abc.LoaderTests):
with util.uncache('__phello__'):
module = machinery.FrozenImporter.load_module('__phello__')
check = {'__name__': '__phello__', '__file__': '<frozen>',
- '__package__': '__phello__', '__path__': ['__phello__']}
+ '__package__': '__phello__', '__path__': ['__phello__'],
+ '__loader__': machinery.FrozenImporter}
for attr, value in check.items():
attr_value = getattr(module, attr)
self.assertEqual(attr_value, value,
@@ -28,7 +29,8 @@ class LoaderTests(abc.LoaderTests):
with util.uncache('__phello__', '__phello__.spam'):
module = machinery.FrozenImporter.load_module('__phello__.spam')
check = {'__name__': '__phello__.spam', '__file__': '<frozen>',
- '__package__': '__phello__'}
+ '__package__': '__phello__',
+ '__loader__': machinery.FrozenImporter}
for attr, value in check.items():
attr_value = getattr(module, attr)
self.assertEqual(attr_value, value,