flake8-pytest-style
flake8-pytest-style copied to clipboard
Set of rules to lint `pytest.ini`
Rule request
Description
On the wave of deprecation rules, here's another idea. The linter could check if the config is following the best practices:
xfail_strict = True(per https://pganssle-talks.github.io/xfail-lightning/)junit_family = xunit2(makes pytest's warnings go away)addoptsargs on separate lines (makes it easier to annotate the purpose with comments, ref https://github.com/ansible/pylibssh/blob/a2453ed/pytest.ini#L2-L16)filterwarningsshould haveerroron the first line (rest of the lines could be legit temporary ignores)-rainaddopts--durationsinaddoptsminversionshould be settestpathsorpyargsshould be specifiednorecursedirspresent
Rationale
The default pytest config is not strict enough.
NB: since pytest 6.0.0, the options can also reside in pyproject.toml. Docs