Skip to content

use select instead of _opcode for import test #372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Lib/test/test_import/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ def test_from_import_missing_attr_has_name_and_path(self):
self.assertRegex(str(cm.exception), "cannot import name 'i_dont_exist' from 'os' \(.*os.py\)")

def test_from_import_missing_attr_has_name_and_so_path(self):
import _opcode
import select
with self.assertRaises(ImportError) as cm:
from _opcode import i_dont_exist
self.assertEqual(cm.exception.name, '_opcode')
self.assertEqual(cm.exception.path, _opcode.__file__)
self.assertRegex(str(cm.exception), "cannot import name 'i_dont_exist' from '_opcode' \(.*\.(so|dll)\)")
from select import i_dont_exist
self.assertEqual(cm.exception.name, 'select')
self.assertEqual(cm.exception.path, select.__file__)
self.assertRegex(str(cm.exception), "cannot import name 'i_dont_exist' from 'select' \(.*\.(so|pyd)\)")

def test_from_import_missing_attr_has_name(self):
with self.assertRaises(ImportError) as cm:
Expand Down