File tree 2 files changed +13
-1
lines changed
Lib/test/test_importlib/extension
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 3
3
machinery = util .import_importlib ('importlib.machinery' )
4
4
5
5
import unittest
6
- import warnings
6
+ import sys
7
7
8
8
9
9
class FinderTests (abc .FinderTests ):
@@ -13,6 +13,10 @@ class FinderTests(abc.FinderTests):
13
13
def setUp (self ):
14
14
if not self .machinery .EXTENSION_SUFFIXES :
15
15
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
+ )
16
20
17
21
def find_spec (self , fullname ):
18
22
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):
20
20
def setUp (self ):
21
21
if not self .machinery .EXTENSION_SUFFIXES :
22
22
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
+ )
23
27
self .loader = self .machinery .ExtensionFileLoader (util .EXTENSIONS .name ,
24
28
util .EXTENSIONS .file_path )
25
29
@@ -97,6 +101,10 @@ def setUp(self):
97
101
if not self .machinery .EXTENSION_SUFFIXES :
98
102
raise unittest .SkipTest ("Requires dynamic loading support." )
99
103
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
+ )
100
108
finder = self .machinery .FileFinder (None )
101
109
self .spec = importlib .util .find_spec (self .name )
102
110
assert self .spec
You can’t perform that action at this time.
0 commit comments