Skip to content

Commit e79e806

Browse files
committed
Make "sys.modules.get('importlib.util')" with "import importlib.util" in test_lazy.py
Without this `./python -m test test_importlib` fails at `test_lazy` although `./python -m test test_importlib.test_lazy` perfectyl succeeds. That is becasue some other tests likely manipulates `util` making the above two out of sync.
1 parent fd952d8 commit e79e806

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_importlib/test_lazy.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
from test.support import threading_helper
1111
from test.test_importlib import util as test_util
1212

13+
# Make sure sys.modules[util] is in sync with the import.
14+
# That is needed as other tests may reload util.
15+
sys.modules['importlib.util'] = util
1316

1417
class CollectInit:
1518

0 commit comments

Comments
 (0)