Skip to content

Commit 4f9a8d0

Browse files
authored
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.
1 parent bfac54d commit 4f9a8d0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Lib/test/test_pyrepl/test_pyrepl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,7 @@ def test_already_imported_module_without_origin_or_spec(self):
11921192
(dir1 / mod).mkdir()
11931193
(dir1 / mod / "__init__.py").touch()
11941194
(dir1 / mod / "foo.py").touch()
1195+
pkgutil.get_importer(_dir1).invalidate_caches()
11951196
module = importlib.import_module(mod)
11961197
assert module.__spec__
11971198
if mod == "no_origin":

0 commit comments

Comments
 (0)