"""Shared fixtures for the clawhdf5 Python binding tests.""" import os import pytest @pytest.fixture(scope="session") def h5py(): """h5py, or a skip — unless CLAWHDF5_REQUIRE_INTEROP=1, which makes a missing h5py a failure (as for the Rust interop suites).""" try: import h5py as mod except ImportError: if os.environ.get("CLAWHDF5_REQUIRE_INTEROP") == "1": pytest.fail("h5py is required (CLAWHDF5_REQUIRE_INTEROP=1) but not importable") pytest.skip("h5py not installed") return mod