Reuse QWeather response fixtures in tests - #14
Conversation
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #14 +/- ##
==========================================
+ Coverage 99.21% 99.26% +0.05%
==========================================
Files 34 34
Lines 4073 4079 +6
Branches 241 241
==========================================
+ Hits 4041 4049 +8
+ Misses 21 19 -2
Partials 11 11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
69aa925 to
bdd02d1
Compare
bdd02d1 to
4a0a721
Compare
1c212b7 to
07a8a9d
Compare
07a8a9d to
69ce8d4
Compare
69ce8d4 to
267637f
Compare
There was a problem hiding this comment.
Pull request overview
Refactors tests/test_weather_context.py to reduce duplication in QWeather-related tests by extracting a shared “single-day forecast” fixture and adding small helper functions for common successful response payloads. This makes scenario-specific differences (status codes, malformed shapes, missing fields) more prominent without altering production behavior.
Changes:
- Extract repeated QWeather 1-day forecast JSON into a shared
_QWEATHER_DAILY_ITEMconstant. - Add
_qweather_weather_response(...)and_qweather_successful_indices_response()helpers to standardize common successful prerequisite responses. - Reuse helpers across multiple QWeather error/air-quality parsing tests while keeping each test’s unique failure condition intact.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Why
The affected tests repeated the same successful prerequisite responses, making their scenario-specific behavior harder to see and maintain.
Impact
This is a test-only refactor. Production behavior and test coverage are unchanged, while the QWeather handlers now emphasize only the response detail each test varies.
Stacking
This PR is based on
fix/rss/ #13 so it reflects the repository's current state. After #13 merges, rebase this branch ontomasterand retarget the PR.Validation
.venv/bin/pytest tests/test_weather_context.py(35 passed).venv/bin/pytest --cov=weather_briefing --cov-branch(311 passed; 99.7066% total coverage).venv/bin/ruff check tests/test_weather_context.pyprek run --all-filesgit diff --check