Skip to content

Commit

Permalink
Extend coverage for `if node.name in FixtureChecker._pytest_fixtures[…
Browse files Browse the repository at this point in the history
…fixname][0].argnames:`

Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
  • Loading branch information
stdedos committed Nov 6, 2023
1 parent c249eb7 commit 8756cc4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions tests/input/unused-argument/func_param_as_fixture_arg.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ def test_myfix(myfix, arg):
def test_nyfix(narg): # unused-argument
"""A test function that does not use its param"""
assert True


@pytest.mark.parametrize("arg", [1, 2, 3])
def test_narg_is_used_nowhere(myfix, narg):
"""A test function that uses the param through a fixture"""
assert myfix
2 changes: 1 addition & 1 deletion tests/test_unused_argument.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ def test_args_and_kwargs(self, enable_plugin):
@pytest.mark.parametrize("enable_plugin", [True, False])
def test_func_param_as_fixture_arg(self, enable_plugin):
self.run_linter(enable_plugin)
self.verify_messages(1 if enable_plugin else 2)
self.verify_messages(2 if enable_plugin else 3)

0 comments on commit 8756cc4

Please sign in to comment.