Skip to content

Fix weather unit tests for get_u and get_v#191

Open
SrijaVuppula wants to merge 1 commit into52North:mainfrom
SrijaVuppula:test/fix-weather-unit-tests
Open

Fix weather unit tests for get_u and get_v#191
SrijaVuppula wants to merge 1 commit into52North:mainfrom
SrijaVuppula:test/fix-weather-unit-tests

Conversation

@SrijaVuppula
Copy link
Copy Markdown

Summary

This PR fixes the weather tests for get_u and get_v so they are actually collected and checked against the correct expected values.

Changes

  • rename get_u -> test_get_u
  • rename get_v -> test_get_v
  • fix assertions so the returned values are compared against expected results
  • correct expected component values for 45°, 135°, 225°, and 315° using sqrt(2) / 2
  • rename the third parametrized expected value from u_res to v_res

Verification

Ran:

./venv/bin/pytest tests/test_weather.py -q
# Result: 12 passed

Also ran:

./.venv/bin/pytest tests/test_utils.py tests/test_weather.py -q
# Result: 39 passed

Notes

Before this change, get_u and get_v did not start with test_, so pytest would not collect them as tests.

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