File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Lib/test/test_importlib/extension Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 33machinery = util .import_importlib ('importlib.machinery' )
44
55import unittest
6- import warnings
6+ import sys
77
88
99class FinderTests (abc .FinderTests ):
@@ -13,6 +13,10 @@ class FinderTests(abc.FinderTests):
1313 def setUp (self ):
1414 if not self .machinery .EXTENSION_SUFFIXES :
1515 raise unittest .SkipTest ("Requires dynamic loading support." )
16+ if util .EXTENSIONS .name in sys .builtin_module_names :
17+ raise unittest .SkipTest (
18+ f"{ util .EXTENSIONS .name } is a builtin module"
19+ )
1620
1721 def find_spec (self , fullname ):
1822 importer = self .machinery .FileFinder (util .EXTENSIONS .path ,
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ class LoaderTests(abc.LoaderTests):
2020 def setUp (self ):
2121 if not self .machinery .EXTENSION_SUFFIXES :
2222 raise unittest .SkipTest ("Requires dynamic loading support." )
23+ if util .EXTENSIONS .name in sys .builtin_module_names :
24+ raise unittest .SkipTest (
25+ f"{ util .EXTENSIONS .name } is a builtin module"
26+ )
2327 self .loader = self .machinery .ExtensionFileLoader (util .EXTENSIONS .name ,
2428 util .EXTENSIONS .file_path )
2529
@@ -97,6 +101,10 @@ def setUp(self):
97101 if not self .machinery .EXTENSION_SUFFIXES :
98102 raise unittest .SkipTest ("Requires dynamic loading support." )
99103 self .name = '_testmultiphase'
104+ if self .name in sys .builtin_module_names :
105+ raise unittest .SkipTest (
106+ f"{ self .name } is a builtin module"
107+ )
100108 finder = self .machinery .FileFinder (None )
101109 self .spec = importlib .util .find_spec (self .name )
102110 assert self .spec
You can’t perform that action at this time.
0 commit comments