Skip to content

fix(tests): test_get_u and test_get_v are never collected by pytest and contain self-referential assertions #161

@pankaj-bind

Description

@pankaj-bind

Bug

tests/test_weather.py contains two test functions - get_u and get_v - that pytest never collects or executes, providing zero coverage for WeatherCond.get_u() and WeatherCond.get_v().

Root cause (5 compounding defects)

  1. Missing test_ prefix - pytest never discovers get_u / get_v
  2. Parameter count mismatch - @parametrize declares 3 params, function signatures accept 2; would crash if collected
  3. Self-referential assertions - assert u_test == pytest.approx(u_test) always passes regardless of correctness
  4. Wrong expected values- e.g. get_u(45, 1) expects -1, actual is -sin(45°) = -0.7071…
  5. Copy-paste error - get_v's parametrize string names the third param u_res instead of v_res

Impact

WeatherCond.get_u() and get_u.get_v() are used in production (apply_get_gauß). Any regression in wind-component decomposition goes completely undetected.

Expected behaviour

Both functions should be collected and executed by pytest with correct expected values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions