mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
GH-115979: update test_importlib to work under WASI SDK 21 (GH-116754)
This commit is contained in:
parent
5ff012a449
commit
61733a2fb9
8 changed files with 44 additions and 27 deletions
|
@ -8,7 +8,8 @@ importlib = util.import_importlib('importlib')
|
|||
machinery = util.import_importlib('importlib.machinery')
|
||||
|
||||
|
||||
@unittest.skipIf(util.EXTENSIONS.filename is None, f'{util.EXTENSIONS.name} not available')
|
||||
@unittest.skipIf(util.EXTENSIONS is None or util.EXTENSIONS.filename is None,
|
||||
'dynamic loading not supported or test module not available')
|
||||
@util.case_insensitive_tests
|
||||
class ExtensionModuleCaseSensitivityTest(util.CASEOKTestBase):
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ class FinderTests(abc.FinderTests):
|
|||
"""Test the finder for extension modules."""
|
||||
|
||||
def setUp(self):
|
||||
if not self.machinery.EXTENSION_SUFFIXES:
|
||||
if not self.machinery.EXTENSION_SUFFIXES or not util.EXTENSIONS:
|
||||
raise unittest.SkipTest("Requires dynamic loading support.")
|
||||
if util.EXTENSIONS.name in sys.builtin_module_names:
|
||||
raise unittest.SkipTest(
|
||||
|
|
|
@ -17,7 +17,7 @@ class LoaderTests:
|
|||
"""Test ExtensionFileLoader."""
|
||||
|
||||
def setUp(self):
|
||||
if not self.machinery.EXTENSION_SUFFIXES:
|
||||
if not self.machinery.EXTENSION_SUFFIXES or not util.EXTENSIONS:
|
||||
raise unittest.SkipTest("Requires dynamic loading support.")
|
||||
if util.EXTENSIONS.name in sys.builtin_module_names:
|
||||
raise unittest.SkipTest(
|
||||
|
@ -99,7 +99,7 @@ class SinglePhaseExtensionModuleTests(abc.LoaderTests):
|
|||
# Test loading extension modules without multi-phase initialization.
|
||||
|
||||
def setUp(self):
|
||||
if not self.machinery.EXTENSION_SUFFIXES:
|
||||
if not self.machinery.EXTENSION_SUFFIXES or not util.EXTENSIONS:
|
||||
raise unittest.SkipTest("Requires dynamic loading support.")
|
||||
self.name = '_testsinglephase'
|
||||
if self.name in sys.builtin_module_names:
|
||||
|
@ -180,7 +180,7 @@ class MultiPhaseExtensionModuleTests(abc.LoaderTests):
|
|||
# Test loading extension modules with multi-phase initialization (PEP 489).
|
||||
|
||||
def setUp(self):
|
||||
if not self.machinery.EXTENSION_SUFFIXES:
|
||||
if not self.machinery.EXTENSION_SUFFIXES or not util.EXTENSIONS:
|
||||
raise unittest.SkipTest("Requires dynamic loading support.")
|
||||
self.name = '_testmultiphase'
|
||||
if self.name in sys.builtin_module_names:
|
||||
|
|
|
@ -5,6 +5,8 @@ machinery = util.import_importlib('importlib.machinery')
|
|||
import unittest
|
||||
|
||||
|
||||
@unittest.skipIf(util.EXTENSIONS is None or util.EXTENSIONS.filename is None,
|
||||
'dynamic loading not supported or test module not available')
|
||||
class PathHookTests:
|
||||
|
||||
"""Test the path hook for extension modules."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue