test(routes): cover remaining HTTP endpoints and switch to integration marker#125
Merged
Conversation
- Add test_routes_public.py: /health, / redirect, feed.xml, sitemap.xml,
robots.txt, favicon, /static/user and /static/{theme} serving
- Add test_routes_auth.py: login redirect/unconfigured/dev bypass,
callback error paths, logout, /auth/me
- Extend test_routes_admin.py: /admin/analytics and full-stack notes CRUD
with CSRF (JSON + HTMX partials, 404s)
- Replace conftest _INTEGRATION_MODULES gating with a
@pytest.mark.integration marker; add fake_github fixture
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds broad HTTP integration coverage for previously untested endpoint groups and updates the integration-test harness to opt in via a pytest marker instead of a hardcoded module allowlist.
Changes:
- Added new integration test modules covering public utility endpoints and OAuth auth routes.
- Extended admin integration tests to cover
/admin/analyticsand full-stack notes CRUD + HTMX partials. - Switched integration gating in
tests/conftest.pyfrom a module-name list to@pytest.mark.integration, and registered the marker in pytest config.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/conftest.py | Switches env pinning + FakeGitHubService injection to marker-based opt-in; adds fake_github fixture. |
| pyproject.toml | Registers the integration marker for pytest. |
| tests/test_routes_public.py | New end-to-end coverage for health, root redirect, feed, sitemap/robots, favicon, and static routes. |
| tests/test_routes_auth.py | New end-to-end coverage for OAuth login/callback/logout/me flows (excluding token exchange). |
| tests/test_routes_admin.py | Adds integration coverage for analytics and notes CRUD + HTMX partial endpoints. |
| tests/test_routes_posts.py | Marks existing integration module with pytestmark = pytest.mark.integration. |
| tests/test_routes_pages.py | Marks existing integration module with pytestmark = pytest.mark.integration. |
| tests/test_routes_webhooks.py | Marks existing integration module with pytestmark = pytest.mark.integration. |
| tests/test_routes_search.py | Marks existing integration module with pytestmark = pytest.mark.integration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #98
45 new integration tests (suite 365 to 410), written after auditing what already existed so nothing is duplicated:
Also resolves the deferred conftest decision from #91: module-name gating replaced with a registered @pytest.mark.integration marker (self-declaring per module, no conftest edit for future modules, strict-markers catches typos), plus a fake_github fixture for tests that mutate content mid-test.
No source changes; no bugs found. One note: /auth/login redirects 307 (FastAPI RedirectResponse default), the issue text said 302; tests assert the actual behavior.
🤖 Generated with Claude Code