forked from PyCQA/pylint-pytest
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add-python-3.12
- Loading branch information
Showing
9 changed files
with
111 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
This module illustrates a situation in which unused-argument should be | ||
suppressed, but is not. | ||
""" | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def myfix(arg): | ||
"""A fixture that requests a function param""" | ||
print("arg is ", arg) | ||
return True | ||
|
||
|
||
@pytest.mark.parametrize("arg", [1, 2, 3]) | ||
def test_myfix(myfix, arg): | ||
"""A test function that uses the param through a fixture""" | ||
assert myfix | ||
|
||
|
||
@pytest.mark.parametrize("narg", [4, 5, 6]) | ||
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 does not use its param (``narg``): | ||
Not itself, nor through a fixture (``myfix``). | ||
""" | ||
assert myfix |
This file contains 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