Skip to content

Conversation

@AdityaGupta716
Copy link

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?

  • Addition of a new feature

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?

  • Add return type hint (-> None) to test_datetime_string_replacement() method
  • Add return type hint (-> None) to test_process_to_keyword_in_sub_input() method

References

Part of #532

How has this PR been tested?

  • No functional changes to the test logic, only type hints added

AdityaGupta716 and others added 5 commits February 7, 2026 12:51
…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.
Add module docstring for custom exceptions.
- 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:
Copy link
Author

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:
Copy link
Author

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:

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