diff --git a/tests/test_integration_users.py b/tests/test_integration_users.py index eb38b6c..4c1cc01 100644 --- a/tests/test_integration_users.py +++ b/tests/test_integration_users.py @@ -97,6 +97,7 @@ def test_client_raises_without_key(self, monkeypatch: pytest.MonkeyPatch) -> Non """Client should raise ConfigurationError when no API key exists.""" monkeypatch.delenv("BG_API_KEY", raising=False) # Patch _load_api_key to ensure no config file fallback + monkeypatch.setattr(Configuration, "_load_api_key", lambda _self: None) with pytest.raises(ConfigurationError): Client(api_key=None) @@ -105,6 +106,7 @@ def test_whitespace_only_api_key_rejected( ) -> None: """Whitespace-only API key should be rejected by Client.""" monkeypatch.delenv("BG_API_KEY", raising=False) + monkeypatch.setattr(Configuration, "_load_api_key", lambda _self: None) with pytest.raises(ConfigurationError): Client(api_key=" ")