""" Root conftest — runs before pytest collects any test files or imports any production modules. Patches config._CONFIG_PATH to point at the test keyring so that `import config` never tries to open the real keyring.yaml. Must live at the repo root (not inside tests/) to fire before collection. """ from pathlib import Path import importlib _TEST_KEYRING = Path(__file__).parent / "tests" / "keyring_test.yaml" # Patch config before anything else imports it import config as _config_mod _config_mod._CONFIG_PATH = _TEST_KEYRING importlib.reload(_config_mod)