Skip to content

test: isolate no-key config tests from local config file - #44

Merged
franccesco merged 1 commit into
mainfrom
fix/isolate-config-tests
Sep 24, 2026
Merged

franccesco merged 1 commit into
mainfrom
fix/isolate-config-tests

Conversation

@franccesco

Copy link
Copy Markdown
Owner

Summary

TestConfiguration::test_client_raises_without_key and test_whitespace_only_api_key_rejected only cleared BG_API_KEY, so on any machine with a key stored in ~/.bloomy/config.yaml the client loaded that key and the tests failed with "DID NOT RAISE ConfigurationError".

Fix

Both tests now patch the config file lookup:
monkeypatch.setattr(Configuration, "_load_api_key", lambda _self: None)

Verification

  • Full suite: 520 passed (with live API)
  • ruff check / ruff format: clean
  • pyright: 0 errors

🤖 Generated with Claude Code

TestConfiguration::test_client_raises_without_key and
test_whitespace_only_api_key_rejected now patch
Configuration._load_api_key to return None, so a key stored in
~/.bloomy/config.yaml no longer makes them fail with
"DID NOT RAISE ConfigurationError".

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@franccesco
franccesco merged commit d561c77 into main Sep 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant