From e1ed95a35af4ea4b729f30333fb47d1161cdc4c2 Mon Sep 17 00:00:00 2001 From: johnslavik Date: Tue, 17 Mar 2026 21:55:35 +0100 Subject: [PATCH] Fix test names and comments to reflect sys.lazy_modules is a dict, not a set --- Lib/test/test_lazy_import/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_lazy_import/__init__.py b/Lib/test/test_lazy_import/__init__.py index a4180f05dbbafc..868c695921223b 100644 --- a/Lib/test/test_lazy_import/__init__.py +++ b/Lib/test/test_lazy_import/__init__.py @@ -484,8 +484,8 @@ def my_filter(name): 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 @@ def test_module_added_to_lazy_modules_on_lazy_import(self): 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) @@ -1532,7 +1532,7 @@ def access_modules(idx): 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