Skip to content

Commit 1692c8e

Browse files
Jammy2211claude
authored andcommitted
test(conftest): make jax import lazy so tests collect without JAX
JAX is now an optional dep gated on python_version >= '3.11'. The eager `import jax` at line 1 of test_autofit/conftest.py was breaking pytest collection on 3.9 and 3.10. Wrap in try/except so the rest of conftest loads. The `recreate` fixture (which uses jax._src.tree_util) will fail if invoked without jax — that's fine, tests using it don't run on a no-jax build. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3c9eb84 commit 1692c8e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test_autofit/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import jax
1+
try:
2+
import jax
3+
except ImportError:
4+
jax = None
25
import multiprocessing
36
import os
47
import shutil

0 commit comments

Comments
 (0)