File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -90,13 +90,14 @@ def test_from_import_missing_attr_has_name_and_path(self):
90
90
self .assertEqual (cm .exception .path , os .__file__ )
91
91
self .assertRegex (str (cm .exception ), r"cannot import name 'i_dont_exist' from 'os' \(.*os.py\)" )
92
92
93
+ @cpython_only
93
94
def test_from_import_missing_attr_has_name_and_so_path (self ):
94
- import select
95
+ import _testcapi
95
96
with self .assertRaises (ImportError ) as cm :
96
- from select import i_dont_exist
97
- self .assertEqual (cm .exception .name , 'select ' )
98
- self .assertEqual (cm .exception .path , select .__file__ )
99
- self .assertRegex (str (cm .exception ), r"cannot import name 'i_dont_exist' from 'select ' \(.*\.(so|pyd)\)" )
97
+ from _testcapi import i_dont_exist
98
+ self .assertEqual (cm .exception .name , '_testcapi ' )
99
+ self .assertEqual (cm .exception .path , _testcapi .__file__ )
100
+ self .assertRegex (str (cm .exception ), r"cannot import name 'i_dont_exist' from '_testcapi ' \(.*\.(so|pyd)\)" )
100
101
101
102
def test_from_import_missing_attr_has_name (self ):
102
103
with self .assertRaises (ImportError ) as cm :
You can’t perform that action at this time.
0 commit comments