Skip to content

Commit bfe5081

Browse files
committed
🔧 Permit many-arg test sigs in lint configs
Parametrized tests that also pull in pytest fixtures legitimately end up with more than the default 5-arg cap that ruff, flake8 (wemake) and pylint all enforce. `PLR0913` (ruff) is added to the `tests/**.py` per-file-ignores in `.ruff.toml`; `WPS211` (wemake) is added to the equivalent section in `.flake8`, alongside an updated rationale comment. pylint's own `R0913` is left to be suppressed inline on the specific test function where it fires; this project does not currently trigger it but the lint configs are mirrored across sibling tox_plugins.* projects for cross-project consistency.
1 parent fee81b1 commit bfe5081

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.flake8

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ per-file-ignores =
104104
# furthermore, we should be able to import and test private attributes
105105
# (WPS450) and modules (WPS436); `pytest.raises()` allows inspecting the
106106
# exception outside the CM (WPS441); additionally test docstrings don't
107-
# need param lists (DAR, DCO020):
108-
tests/**.py: DAR, DCO020, S101, S108, WPS430, WPS436, WPS441, WPS442, WPS450
107+
# need param lists (DAR, DCO020); parametrized tests that also take
108+
# pytest fixtures legitimately end up with many args (WPS211):
109+
tests/**.py: DAR, DCO020, S101, S108, WPS211, WPS430, WPS436, WPS441, WPS442, WPS450
109110

110111
tests/importable_test.py: ANN101, DAR
111112

.ruff.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ testing = [
8585
# these will need to be added to that line as well.
8686

8787
"PLC2701", # Allow importing internal files needed for testing
88+
"PLR0913", # Allow parametrized + fixture test signatures with many args
8889
"S101", # Allow use of `assert` in test files
8990
]
9091

0 commit comments

Comments
 (0)