summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-02-01 19:51:43 (GMT)
committerBrett Cannon <brett@python.org>2013-02-01 19:51:43 (GMT)
commitf41fa4f3a0b12161d8fcd58deb07756df929f405 (patch)
treebc8c8d934c7c595d8d633dbc64bef7fdb39035fb /Lib/test/test_importlib
parent611afc1b3fd0183b1d386474ef5665cee43009ed (diff)
parente7387b470876e6f3a2f4b45ed47a7a061c9fdc99 (diff)
downloadcpython-f41fa4f3a0b12161d8fcd58deb07756df929f405.zip
cpython-f41fa4f3a0b12161d8fcd58deb07756df929f405.tar.gz
cpython-f41fa4f3a0b12161d8fcd58deb07756df929f405.tar.bz2
merge with 3.3
Diffstat (limited to 'Lib/test/test_importlib')
-rw-r--r--Lib/test/test_importlib/test_api.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/Lib/test/test_importlib/test_api.py b/Lib/test/test_importlib/test_api.py
index ef6629a..7acb4ce 100644
--- a/Lib/test/test_importlib/test_api.py
+++ b/Lib/test/test_importlib/test_api.py
@@ -4,6 +4,7 @@ import importlib
from importlib import machinery
import sys
from test import support
+import types
import unittest
@@ -175,13 +176,15 @@ class FrozenImportlibTests(unittest.TestCase):
machinery.FrozenImporter))
-def test_main():
- from test.support import run_unittest
- run_unittest(ImportModuleTests,
- FindLoaderTests,
- InvalidateCacheTests,
- FrozenImportlibTests)
+class StartupTests(unittest.TestCase):
+
+ def test_everyone_has___loader__(self):
+ # Issue #17098: all modules should have __loader__ defined.
+ for name, module in sys.modules.items():
+ if isinstance(module, types.ModuleType):
+ self.assertTrue(hasattr(module, '__loader__'),
+ '{!r} lacks a __loader__ attribute'.format(name))
if __name__ == '__main__':
- test_main()
+ unittest.main()