Skip to content

fix(tests): resolve uncollected weather tests and correct assertions (#161) - #201

Open
vaaiiibbhav wants to merge 1 commit into
52North:mainfrom
vaaiiibbhav:vaibhav/fix-weather-tests
Open

fix(tests): resolve uncollected weather tests and correct assertions (#161)#201
vaaiiibbhav wants to merge 1 commit into
52North:mainfrom
vaaiiibbhav:vaibhav/fix-weather-tests

Conversation

@vaaiiibbhav

Copy link
Copy Markdown

Related Issue / Discussion:

Fixes Issue #161

Changes:

Please list the central functionalities that have been changed:

  • Modified tests/test_weather.py

Further Details:

Summary:

  • Motivation: The test infrastructure for the WeatherCond class (get_u() and get_v() methods) was completely broken and omitted during test collection.
  • Before:
    • Test functions lacked the test_ prefix, preventing pytest from discovering them.
    • Parameter counts in @pytest.mark.parametrize did not match the function signatures.
    • Assertions were self-referential (e.g., checking if a variable equaled itself) or mathematically incorrect regarding the inverse logic for test_theta_from_uv.
  • After:
    • Renamed functions to follow proper test_ prefixes.
    • Aligned function signatures with the parametrized decorators (u_res / v_res).
    • Implemented proper value checks utilizing pytest.approx() and updated the test data (windspeed = np.sqrt(2)) to ensure mathematical accuracy. Total active passing tests in this file increased from 4 to 12.

Dependencies:

No new dependencies are required for this modification.

PR Checklist:

In the context of this PR, I:

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