From aed90508b3112aa5294c6d4ff6c2026e3c794129 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Langa?= Date: Mon, 5 Jan 2026 18:00:48 +0100 Subject: [PATCH] gh-69605: In test_pyrepl.test_already_imported*, invalidate FS import caches (#143436) This makes the test robust against file systems with low timestamp resolution, which otherwise would fail to re-import in the tight loop of the test. --- Lib/test/test_pyrepl/test_pyrepl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index d0ad960219b5..b1c6e5c99696 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -1192,6 +1192,7 @@ class TestPyReplModuleCompleter(TestCase): (dir1 / mod).mkdir() (dir1 / mod / "__init__.py").touch() (dir1 / mod / "foo.py").touch() + pkgutil.get_importer(_dir1).invalidate_caches() module = importlib.import_module(mod) assert module.__spec__ if mod == "no_origin": -- 2.47.3