Skip to content

test: improve temperature_utils.py coverage from 63% to 95%+ #261

@Orinks

Description

@Orinks

Problem

temperature_utils.py currently has only 63% test coverage. The uncovered lines include:

  • _normalize_dewpoint_unit() string normalization paths (line 72-79)
  • calculate_dewpoint() edge cases: non-numeric inputs, zero humidity, Celsius mode (lines 108-110, 114, 132-133)
  • format_temperature() with temperature_c only, smart precision logic, BOTH unit mode (lines 167, 171, 184-185, 190-193)
  • get_temperature_values() various None combinations (lines 212-221)

Solution

Add comprehensive unit tests covering all branches and edge cases.

Acceptance Criteria

  • Coverage of temperature_utils.py reaches 95%+
  • All existing tests continue to pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions