"""All tests use disposable user credential state, including legacy test scripts.""" import pytest @pytest.fixture(autouse=True) def isolated_user_credentials(monkeypatch, tmp_path, tmp_path_factory): monkeypatch.chdir(tmp_path) monkeypatch.setenv("NAPSEER_USER_DATA_DIR", str(tmp_path_factory.mktemp("napseer-user"))) for name in ("NAPSEER_API_KEY", "NAPSEER_TOKEN", "NAPSEER_REFRESH_TOKEN", "NAPSEER_AUTH_FILE", "NAPSEER_PROJECT_ROOT", "NAPSEER_PROJECT_ID", "NAPSEER_BASE_URL"): monkeypatch.delenv(name, raising=False)