Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing tidetools test #115

Merged
merged 1 commit into from
Dec 23, 2024
Merged

Fix failing tidetools test #115

merged 1 commit into from
Dec 23, 2024

Conversation

douglatornell
Copy link
Member

@douglatornell douglatornell commented Dec 23, 2024

Summary

This Pull Request includes changes focused on enhancing the failing test for the tidetools.get_run_length function, within the Salish Sea tools project. Specifically, this refines the structure of the unit test and solves reliability issues.

  • Refactored the test_get_run_length function by using the tmp_path strategy to dynamically create a temporary directory and namelist file.
  • Introduced the textwrap.dedent module for better formatting of test data in the test.
  • Removed mocked operations (mock_open, patch) and replaced them with a tmp_path-based approach to improve test reliability during filesystem interactions.Refactor and enhance get_run_length test logic

Replaced mocked file handling with temporary file creation using `tmp_path`.
 This ensures better test reliability and readability by using actual file
 I/O for the namelist input.
@douglatornell douglatornell added the bug Something isn't working label Dec 23, 2024
@douglatornell douglatornell added this to the v24.1 milestone Dec 23, 2024
@douglatornell douglatornell merged commit f3380c6 into main Dec 23, 2024
4 checks passed
@douglatornell douglatornell deleted the fix-tidetools-test branch December 23, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant