Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8709b23

Browse files
authored
bpo-33465: Use an unlikely to be built-in C extension in a test (#6797)
1 parent389a48e commit8709b23

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎Lib/test/test_import/__init__.py‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,14 @@ def test_from_import_missing_attr_has_name_and_path(self):
9090
self.assertEqual(cm.exception.path,os.__file__)
9191
self.assertRegex(str(cm.exception),r"cannot import name 'i_dont_exist' from 'os' \(.*os.py\)")
9292

93+
@cpython_only
9394
deftest_from_import_missing_attr_has_name_and_so_path(self):
94-
importselect
95+
import_testcapi
9596
withself.assertRaises(ImportError)ascm:
96-
fromselectimporti_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_testcapiimporti_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)\)")
100101

101102
deftest_from_import_missing_attr_has_name(self):
102103
withself.assertRaises(ImportError)ascm:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp