use select instead of _opcode for import test (#372)

This commit is contained in:
Benjamin Peterson 2017-02-28 23:14:09 -08:00 committed by GitHub
parent bee93f2d04
commit 371963daba
1 changed files with 5 additions and 5 deletions

View File

@ -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: