Skip to content

refactor: use usefixtures marker in tests - #3606

Merged
mkoura merged 1 commit into
masterfrom
usefixtures_marker
Aug 11, 2026
Merged

refactor: use usefixtures marker in tests#3606
mkoura merged 1 commit into
masterfrom
usefixtures_marker

Conversation

@mkoura

@mkoura mkoura commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

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.

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.
@mkoura
mkoura requested a review from saratomaz as a code owner August 11, 2026 16:21
@mkoura
mkoura requested a lite review from Copilot and removed request for saratomaz August 11, 2026 16:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: ARG002 fixture 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_env depending on set_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.

@mkoura
mkoura merged commit d1f74cc into master Aug 11, 2026
4 checks passed
@mkoura
mkoura deleted the usefixtures_marker branch August 11, 2026 16:30
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.

2 participants