Skip to content

Commit 19c49bb

Browse files
committed
Tests: clean FileFinder cache
1 parent ed8ce73 commit 19c49bb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_pyrepl/test_pyrepl.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import itertools
44
import os
55
import pathlib
6+
import pkgutil
67
import re
78
import rlcompleter
89
import select
@@ -1131,6 +1132,8 @@ def test_already_imported_custom_module_no_other_suggestions(self):
11311132
(dir2 / "mymodule").mkdir()
11321133
(dir2 / "mymodule" / "__init__.py").touch()
11331134
(dir2 / "mymodule" / "bar.py").touch()
1135+
# Purge FileFinder cache after adding files
1136+
pkgutil.get_importer(_dir2).invalidate_caches()
11341137
# mymodule found in dir2 before dir1, but it was already imported
11351138
# from dir1 -> suggest dir1 submodules only
11361139
events = code_to_events("import mymodule.\t\n")

0 commit comments

Comments
 (0)