]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-145057: Fix test names and comments to reflect `sys.lazy_modules` is a dict, not...
authorBartosz Sławecki <bartosz@ilikepython.com>
Fri, 27 Mar 2026 21:35:50 +0000 (22:35 +0100)
committerGitHub <noreply@github.com>
Fri, 27 Mar 2026 21:35:50 +0000 (14:35 -0700)
Fix test names and comments to reflect sys.lazy_modules is a dict, not a set

Lib/test/test_lazy_import/__init__.py

index 328f2906f901597d155f99ad66a6b553aa849853..6e53e2c042bc16bbfe63ae139af7e1641f8b653e 100644 (file)
@@ -484,8 +484,8 @@ class SysLazyImportsAPITests(unittest.TestCase):
         sys.set_lazy_imports_filter(my_filter)
         self.assertIs(sys.get_lazy_imports_filter(), my_filter)
 
-    def test_lazy_modules_attribute_is_set(self):
-        """sys.lazy_modules should be a set per PEP 810."""
+    def test_lazy_modules_attribute_is_dict(self):
+        """sys.lazy_modules should be a dict per PEP 810."""
         self.assertIsInstance(sys.lazy_modules, dict)
 
     @support.requires_subprocess()
@@ -966,7 +966,7 @@ class SysLazyModulesTrackingTests(unittest.TestCase):
 
     def test_lazy_modules_is_per_interpreter(self):
         """Each interpreter should have independent sys.lazy_modules."""
-        # Basic test that sys.lazy_modules exists and is a set
+        # Basic test that sys.lazy_modules exists and is a dict
         self.assertIsInstance(sys.lazy_modules, dict)
 
 
@@ -1575,7 +1575,7 @@ class ThreadSafetyTests(unittest.TestCase):
         self.assertEqual(result.returncode, 0, f"stdout: {result.stdout}, stderr: {result.stderr}")
         self.assertIn("OK", result.stdout)
 
-    def test_concurrent_lazy_modules_set_updates(self):
+    def test_concurrent_lazy_modules_dict_updates(self):
         """Multiple threads creating lazy imports should safely update sys.lazy_modules."""
         code = textwrap.dedent("""
             import sys