From 4917c2e30f49b1cadffaf1008286f036fd2fd7c7 Mon Sep 17 00:00:00 2001 From: Roma Knyaz Date: Mon, 2 Oct 2023 17:17:32 +0200 Subject: [PATCH] Fix flakiness of transitive import hook test --- test/test_import_hook.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_import_hook.py b/test/test_import_hook.py index 6a1ef73..ebe1c84 100644 --- a/test/test_import_hook.py +++ b/test/test_import_hook.py @@ -125,6 +125,8 @@ def test_import_hook_transitive(importhook_tempdir): with open(transitive_dir / "__init__.py", "w") as f: f.write("from . import tester") f.flush() + + importlib.invalidate_caches() with jaxtyping.install_import_hook(transitive_name, typechecker): importlib.import_module(transitive_name) assert counter + 1 == jaxtyping._test_import_hook_counter