Skip to content

test: add unit tests for current_conditions.py (8% → 95% coverage)#260

Merged
Orinks merged 1 commit intodevfrom
add-current-conditions-tests
Feb 7, 2026
Merged

test: add unit tests for current_conditions.py (8% → 95% coverage)#260
Orinks merged 1 commit intodevfrom
add-current-conditions-tests

Conversation

@Orinks
Copy link
Owner

@Orinks Orinks commented Feb 7, 2026

Summary

Add 86 unit tests for src/accessiweather/display/presentation/current_conditions.py, bringing coverage from 8% to 95%.

What's tested

  • format_temperature_value - all unit preferences and edge cases
  • _build_basic_metrics - full data, minimal data, hidden fields
  • _build_astronomical_metrics - with/without times, moon phase
  • _build_environmental_metrics - air quality, pollen, edge cases
  • _build_seasonal_metrics - snow, wind chill, heat index, frost, freezing level, precipitation, severe risk
  • _build_trend_metrics - with/without trends, sparklines, pressure filtering
  • compute_pressure_trend_from_hourly - inHg, mb, missing data
  • describe_trend, direction_descriptor, split_direction_descriptor
  • _categorize_metric, _order_metrics_by_priority
  • format_trend_lines, _get_severe_risk_description
  • build_current_conditions integration tests

Validation

  • uv run ruff check . passes
  • uv run pytest passes (911 tests, 1 skipped)

Closes #259

Add 86 tests covering all public functions in the current conditions
presentation module including temperature formatting, seasonal metrics,
astronomical metrics, environmental metrics, trend computation, and
the main build_current_conditions integration.

Closes #259
@Orinks Orinks merged commit d8f60db into dev Feb 7, 2026
6 checks passed
@Orinks Orinks deleted the add-current-conditions-tests branch February 7, 2026 22:00
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