test: improve tests#20
Conversation
- Add reset_context() to foundry.py for use in test teardown - Extend make_context() to accept version, environment, and **kwargs - Add unit tests for reset_context() behaviour Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace monkeypatch.setattr("...foundry._context", None) with the public
reset_context() API in foundry_test.py and console_test.py autouse
fixtures.
Also adds a minimal _gui_context autouse fixture to TestGetGuiUser in
gui_test.py to fix a latent ordering bug exposed by the stricter teardown:
get_gui_user() calls load_settings(AuthSettings) -> get_context(), so a
context must be set before those tests run.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Delete the local _mk_ctx helper and the three monkeypatch.setattr autouse fixtures that stubbed get_context. Replace them with set_context(FoundryContext(...)) + reset_context() so the real code path runs. Replace _mk_ctx call sites with inline FoundryContext construction using module-level constants. Reclassify TestSentryInitialize, TestSentrySettingsDsnValidation, and TestSentrySettings from @pytest.mark.unit to @pytest.mark.integration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9809977 to
20d0392
Compare
|
Claude encountered an error —— View job Code Review Complete ✅Reviewing PR #20: test: improve tests SummaryThis PR successfully implements ✅ Strengths1. Excellent
|
|



reset_contextfunction