rstudio / rstudio/pins-python

Enable `pytest` convention rules `PT` in ruff

Open
#278 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

.maint testing
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.