Fix flakiness of transitive import hook test

This commit is contained in:
Roma Knyaz
2023-10-02 09:03:06 -07:00
committed by Patrick Kidger
parent 17092ad8d8
commit 4917c2e30f
+2
View File
@@ -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