Enable `pytest` convention rules `PT` in ruff
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 59
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
There are many ways to do the same thing in pytest, and I have found these rules to be helpful for consistency across a codebase.
There are a few that are arguably too opinionated, in particular PT003, PT004, and PT013.
PT006 can be configured with:
[tool.ruff.lint.flake8-pytest-style]
parametrize-names-type = "csv"
for consistency with the existing codebase.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file or test is named; start by locating the Ruff configuration and any pytest-related lint setup. Enable the PT rules, resolve the stated exceptions for PT003, PT004, and PT013, apply the PT006 configuration, and verify the resulting lint configuration against the existing codebase.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa, tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100