summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib/test_api.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_importlib/test_api.py')
-rw-r--r--Lib/test/test_importlib/test_api.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/test_api.py b/Lib/test/test_importlib/test_api.py
index 2a35f3d..973237c 100644
--- a/Lib/test/test_importlib/test_api.py
+++ b/Lib/test/test_importlib/test_api.py
@@ -6,6 +6,7 @@ machinery = test_util.import_importlib('importlib.machinery')
import os.path
import sys
+from test import support
from test.support import import_helper
from test.support import os_helper
import types
@@ -437,5 +438,44 @@ class StartupTests:
) = test_util.test_both(StartupTests, machinery=machinery)
+class TestModuleAll(unittest.TestCase):
+ def test_machinery(self):
+ extra = (
+ # from importlib._bootstrap and importlib._bootstrap_external
+ 'AppleFrameworkLoader',
+ 'BYTECODE_SUFFIXES',
+ 'BuiltinImporter',
+ 'DEBUG_BYTECODE_SUFFIXES',
+ 'EXTENSION_SUFFIXES',
+ 'ExtensionFileLoader',
+ 'FileFinder',
+ 'FrozenImporter',
+ 'ModuleSpec',
+ 'NamespaceLoader',
+ 'OPTIMIZED_BYTECODE_SUFFIXES',
+ 'PathFinder',
+ 'SOURCE_SUFFIXES',
+ 'SourceFileLoader',
+ 'SourcelessFileLoader',
+ 'WindowsRegistryFinder',
+ )
+ support.check__all__(self, machinery['Source'], extra=extra)
+
+ def test_util(self):
+ extra = (
+ # from importlib.abc, importlib._bootstrap
+ # and importlib._bootstrap_external
+ 'Loader',
+ 'MAGIC_NUMBER',
+ 'cache_from_source',
+ 'decode_source',
+ 'module_from_spec',
+ 'source_from_cache',
+ 'spec_from_file_location',
+ 'spec_from_loader',
+ )
+ support.check__all__(self, util['Source'], extra=extra)
+
+
if __name__ == '__main__':
unittest.main()