refactor: use usefixtures marker in tests - #3606
Merged
Merged
Conversation
Convert unused None-returning fixture parameters (annotated with `# noqa: ARG002`) in test method signatures to `@pytest.mark.usefixtures` markers. Affects 35 tests in test_env_network_id.py, test_socket_path.py, test_mir_certs.py and test_metrics.py. Fixture-signature dependencies (`# noqa: ARG001`) are kept as parameters, since usefixtures markers have no effect on fixtures. Fixture setup order is unchanged: the converted fixtures declare their own dependencies.
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors E2E test functions to request “setup-only” fixtures via @pytest.mark.usefixtures instead of unused None-typed parameters, reducing noise in test signatures while keeping fixture behavior the same.
Changes:
- Replaced unused
# noqa: ARG002fixture parameters with@pytest.mark.usefixtures(...)on affected tests. - Simplified test method signatures where the only purpose of a parameter was to trigger fixture execution.
- Preserved fixture dependency ordering via explicit fixture dependencies (e.g.,
skip_on_no_envdepending onset_network_id_env).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cardano_node_tests/tests/test_socket_path.py | Uses usefixtures("set_socket_path") to trigger socket-path environment setup without unused parameters. |
| cardano_node_tests/tests/test_mir_certs.py | Uses usefixtures("skip_on_hf_shortcut") to trigger conditional skipping without unused parameters. |
| cardano_node_tests/tests/test_metrics.py | Uses usefixtures("wait_epochs") and removes the now-unneeded fixture parameter from signatures. |
| cardano_node_tests/tests/test_env_network_id.py | Uses usefixtures("skip_on_no_env", "set_network_id_env") to trigger env setup and conditional skip without unused parameters. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Convert unused None-returning fixture parameters (annotated with
# noqa: ARG002) in test method signatures to@pytest.mark.usefixturesmarkers. Affects 35 tests in test_env_network_id.py, test_socket_path.py, test_mir_certs.py and test_metrics.py.Fixture-signature dependencies (
# noqa: ARG001) are kept as parameters, since usefixtures markers have no effect on fixtures. Fixture setup order is unchanged: the converted fixtures declare their own dependencies.