astral-sh / astral-sh/ruff

pytest rules to ban xunit-style setup

Open
#20,102 0 comments 0 reactions 0 assignees View on GitHub
needs-decision rule
Dominant language
Rust
Stars
49.6k
Forks
2.4k
Avg merge
2d 1h
Merged PRs (30d)
445

Description

### Summary

It would be nice if Ruff had (optional) rules to ban pytest's xunit-style setup methods and encourage fixtures instead: https://docs.pytest.org/en/stable/how-to/xunit_setup.html

- setup_module
- teardown_module
- setup_class
- teardown_class
- setup_method
- teardown_method
- setup_function
- teardown_function

Contributor guide

Open the contributing guide

Research direction

Start with the linked pytest xunit setup documentation and review Ruff's existing rule conventions. Define optional rules covering the eight listed setup and teardown methods, with diagnostics that encourage fixtures, then add coverage for each method and verify the rules behave as configured.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
testing, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.