diff --git a/README.md b/README.md index d9f2e7a24a..fc42e55c16 100644 --- a/README.md +++ b/README.md @@ -920,8 +920,8 @@ For more, see [flake8-pytest-style](https://pypi.org/project/flake8-pytest-style | PT001 | IncorrectFixtureParenthesesStyle | Use `@pytest.fixture()` over `@pytest.fixture` | 🛠 | | PT002 | FixturePositionalArgs | Configuration for fixture `...` specified via positional args, use kwargs | | | PT003 | ExtraneousScopeFunction | `scope='function'` is implied in `@pytest.fixture()` | | -| PT004 | MissingFixtureNameUnderscore | Fixture `...` does not return anything, add leading underscore | 🛠 | -| PT005 | IncorrectFixtureNameUnderscore | Fixture `...` returns a value, remove leading underscore | 🛠 | +| PT004 | MissingFixtureNameUnderscore | Fixture `...` does not return anything, add leading underscore | | +| PT005 | IncorrectFixtureNameUnderscore | Fixture `...` returns a value, remove leading underscore | | | PT006 | ParametrizeNamesWrongType | Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 🛠 | | PT007 | ParametrizeValuesWrongType | Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` | | | PT008 | PatchWithLambda | Use `return_value=` instead of patching with `lambda` | | diff --git a/src/violations.rs b/src/violations.rs index 644c21edfa..849a7b06e3 100644 --- a/src/violations.rs +++ b/src/violations.rs @@ -5439,16 +5439,12 @@ impl Violation for ExtraneousScopeFunction { define_violation!( pub struct MissingFixtureNameUnderscore(pub String); ); -impl AlwaysAutofixableViolation for MissingFixtureNameUnderscore { +impl Violation for MissingFixtureNameUnderscore { fn message(&self) -> String { let MissingFixtureNameUnderscore(function) = self; format!("Fixture `{function}` does not return anything, add leading underscore") } - fn autofix_title(&self) -> String { - "Add leading underscore".to_string() - } - fn placeholder() -> Self { MissingFixtureNameUnderscore("...".to_string()) } @@ -5457,16 +5453,12 @@ impl AlwaysAutofixableViolation for MissingFixtureNameUnderscore { define_violation!( pub struct IncorrectFixtureNameUnderscore(pub String); ); -impl AlwaysAutofixableViolation for IncorrectFixtureNameUnderscore { +impl Violation for IncorrectFixtureNameUnderscore { fn message(&self) -> String { let IncorrectFixtureNameUnderscore(function) = self; format!("Fixture `{function}` returns a value, remove leading underscore") } - fn autofix_title(&self) -> String { - "Remove leading underscore".to_string() - } - fn placeholder() -> Self { IncorrectFixtureNameUnderscore("...".to_string()) }