Skip to content

Commit 8a6f6b5

Browse files
committed
workaround for test that doesn't expect frozen os module
1 parent 37bc84b commit 8a6f6b5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

graalpython/lib-python/3/test/test_import/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ def test_from_import_missing_attr_raises_ImportError(self):
8686
from importlib import something_that_should_not_exist_anywhere
8787

8888
def test_from_import_missing_attr_has_name_and_path(self):
89+
# truffle change: replace usage of frozen os module with something else
8990
with self.assertRaises(ImportError) as cm:
90-
from os import i_dont_exist
91-
self.assertEqual(cm.exception.name, 'os')
92-
self.assertEqual(cm.exception.path, os.__file__)
93-
self.assertRegex(str(cm.exception), r"cannot import name 'i_dont_exist' from 'os' \(.*os.py\)")
91+
from test.support import i_dont_exist
92+
self.assertEqual(cm.exception.name, 'test.support')
93+
self.assertEqual(cm.exception.path, test.support.__file__)
94+
self.assertRegex(str(cm.exception), r"cannot import name 'i_dont_exist' from 'test.support' \(.*test/support/__init__.py\)")
9495

9596
@cpython_only
9697
def test_from_import_missing_attr_has_name_and_so_path(self):

0 commit comments

Comments
 (0)