aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_importlib/test_spec.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_importlib/test_spec.py')
-rw-r--r--Lib/test/test_importlib/test_spec.py9
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 80aa3609c6f..02318926f35 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)