diff options
author | Brett Cannon <brett@python.org> | 2024-03-13 20:24:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-13 20:24:28 (GMT) |
commit | 61733a2fb9dc36d2246d922146a3462a2248832d (patch) | |
tree | 29f52f4623091c581a62700d57fe24dbe006542b /Lib/test/test_importlib/test_spec.py | |
parent | 5ff012a4495060fe9f53ed034c90033e7eafb780 (diff) | |
download | cpython-61733a2fb9dc36d2246d922146a3462a2248832d.zip cpython-61733a2fb9dc36d2246d922146a3462a2248832d.tar.gz cpython-61733a2fb9dc36d2246d922146a3462a2248832d.tar.bz2 |
GH-115979: update test_importlib to work under WASI SDK 21 (GH-116754)
Diffstat (limited to 'Lib/test/test_importlib/test_spec.py')
-rw-r--r-- | Lib/test/test_importlib/test_spec.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_importlib/test_spec.py b/Lib/test/test_importlib/test_spec.py index 80aa360..0231892 100644 --- a/Lib/test/test_importlib/test_spec.py +++ b/Lib/test/test_importlib/test_spec.py @@ -502,7 +502,8 @@ class FactoryTests: self.assertEqual(spec.loader, self.fileloader) self.assertEqual(spec.origin, self.path) self.assertIs(spec.loader_state, None) - self.assertEqual(spec.submodule_search_locations, [os.getcwd()]) + location = cwd if (cwd := os.getcwd()) != '/' else '' + self.assertEqual(spec.submodule_search_locations, [location]) self.assertEqual(spec.cached, self.cached) self.assertTrue(spec.has_location) @@ -601,7 +602,8 @@ class FactoryTests: self.assertEqual(spec.loader, self.fileloader) self.assertEqual(spec.origin, self.path) self.assertIs(spec.loader_state, None) - self.assertEqual(spec.submodule_search_locations, [os.getcwd()]) + location = cwd if (cwd := os.getcwd()) != '/' else '' + self.assertEqual(spec.submodule_search_locations, [location]) self.assertEqual(spec.cached, self.cached) self.assertTrue(spec.has_location) @@ -626,7 +628,8 @@ class FactoryTests: self.assertEqual(spec.loader, self.pkgloader) self.assertEqual(spec.origin, self.path) self.assertIs(spec.loader_state, None) - self.assertEqual(spec.submodule_search_locations, [os.getcwd()]) + location = cwd if (cwd := os.getcwd()) != '/' else '' + self.assertEqual(spec.submodule_search_locations, [location]) self.assertEqual(spec.cached, self.cached) self.assertTrue(spec.has_location) |