mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-94217: Skip import tests when _testcapi is a builtin (GH-94218)
(cherry picked from commit 0a40025b80
)
Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
b140e5a4ac
commit
89ba660717
2 changed files with 13 additions and 1 deletions
|
@ -3,7 +3,7 @@ from test.test_importlib import abc, util
|
|||
machinery = util.import_importlib('importlib.machinery')
|
||||
|
||||
import unittest
|
||||
import warnings
|
||||
import sys
|
||||
|
||||
|
||||
class FinderTests(abc.FinderTests):
|
||||
|
@ -13,6 +13,10 @@ class FinderTests(abc.FinderTests):
|
|||
def setUp(self):
|
||||
if not self.machinery.EXTENSION_SUFFIXES:
|
||||
raise unittest.SkipTest("Requires dynamic loading support.")
|
||||
if util.EXTENSIONS.name in sys.builtin_module_names:
|
||||
raise unittest.SkipTest(
|
||||
f"{util.EXTENSIONS.name} is a builtin module"
|
||||
)
|
||||
|
||||
def find_spec(self, fullname):
|
||||
importer = self.machinery.FileFinder(util.EXTENSIONS.path,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue