-
Notifications
You must be signed in to change notification settings - Fork 37
Add type hints to test_unit.py test methods (#532) #683
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
base: main
Are you sure you want to change the base?
Add type hints to test_unit.py test methods (#532) #683
Conversation
…euroinformatics-unit#617) Updated keyboard shortcut tooltips in tooltips.py to emphasize CTRL+C (with SHIFT) instead of CTRL+Q for copying filepath to clipboard. CTRL+Q quits the application on macOS, so CTRL+C is the more appropriate shortcut for users on that platform.
for more information, see https://pre-commit.ci
Add module docstring for custom exceptions.
for more information, see https://pre-commit.ci
- Add return type hints (-> None) to test methods in test_unit.py - Specifically: test_datetime_string_replacement and test_process_to_keyword_in_sub_input - Part of issue neuroinformatics-unit#532 effort to extend type hints to test files
| "key", [tags("date"), tags("time"), tags("datetime")] | ||
| ) | ||
| def test_datetime_string_replacement(self, key, underscore_position): | ||
| def test_datetime_string_replacement(self, key, underscore_position): -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Syntax error: The return type hint should come before the colon, not after it.
Should be: def test_datetime_string_replacement(self, key, underscore_position) -> None:
Not: def test_datetime_string_replacement(self, key, underscore_position): -> None:
This is causing the pre-commit.ci check to fail with a SyntaxError.
|
|
||
| @pytest.mark.parametrize("prefix", ["sub", "ses"]) | ||
| def test_process_to_keyword_in_sub_input(self, prefix): | ||
| def test_process_to_keyword_in_sub_input(self, prefix): -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same syntax error here. The return type hint should come before the colon.
Should be: def test_process_to_keyword_in_sub_input(self, prefix) -> None:
Not: def test_process_to_keyword_in_sub_input(self, prefix): -> None:
Description
This PR continues to add type hints to test files as described in issue #532. This PR focuses on adding return type hints to test methods in test_unit.py.
What is this PR?
Why is this PR needed?
Continuing the effort to extend type hints to test files to improve code readability and enable better IDE support.
What does this PR do?
References
Part of #532
How has this PR been tested?