Kaydet (Commit) 371963da authored tarafından Benjamin Peterson's avatar Benjamin Peterson Kaydeden (comit) GitHub

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

üst bee93f2d
......@@ -88,12 +88,12 @@ class ImportTests(unittest.TestCase):
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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment