Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set of rules to lint pytest.ini #24

Open
webknjaz opened this issue Apr 22, 2020 · 1 comment
Open

Set of rules to lint pytest.ini #24

webknjaz opened this issue Apr 22, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@webknjaz
Copy link
Contributor

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:

  1. xfail_strict = True (per https://pganssle-talks.github.io/xfail-lightning/)
  2. junit_family = xunit2 (makes pytest's warnings go away)
  3. addopts args on separate lines (makes it easier to annotate the purpose with comments, ref https://github.com/ansible/pylibssh/blob/a2453ed/pytest.ini#L2-L16)
  4. filterwarnings should have error on the first line (rest of the lines could be legit temporary ignores)
  5. -ra in addopts
  6. --durations in addopts
  7. minversion should be set
  8. testpaths or pyargs should be specified
  9. norecursedirs present

Rationale

The default pytest config is not strict enough.

@m-burst m-burst added the enhancement New feature or request label May 7, 2020
@m-burst
Copy link
Owner

m-burst commented Jul 30, 2020

NB: since pytest 6.0.0, the options can also reside in pyproject.toml. Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants