From 710c60f7135879b05f6c05a34085cd7af5c19e7f Mon Sep 17 00:00:00 2001 From: GiGaGon <107241144+MeGaGiGaGon@users.noreply.github.com> Date: Thu, 3 Jul 2025 07:29:26 -0700 Subject: [PATCH] [`flake8-pytest-style`] Make example error out-of-the-box (`PT023`) (#19104) ## Summary Part of #18972 This PR makes [pytest-incorrect-mark-parentheses-style (PT023)](https://docs.astral.sh/ruff/rules/pytest-incorrect-mark-parentheses-style/#pytest-incorrect-mark-parentheses-style-pt023)'s example error out-of-the-box [Old example](https://play.ruff.rs/48989153-6d4a-493a-a287-07f330f270bc) ```py import pytest @pytest.mark.foo def test_something(): ... ``` [New example](https://play.ruff.rs/741f4d19-4607-4777-a77e-4ea6c62845e1) ```py import pytest @pytest.mark.foo() def test_something(): ... ``` This just swaps the parenthesis in the "Example" and "Use instead" sections since the default configuration is no parenthesis ## Test Plan N/A, no functionality/tests affected --- .../ruff_linter/src/rules/flake8_pytest_style/rules/marks.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/rules/marks.rs b/crates/ruff_linter/src/rules/flake8_pytest_style/rules/marks.rs index 76ffcb71d1..4931a24c9d 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/rules/marks.rs +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/rules/marks.rs @@ -31,7 +31,7 @@ use crate::rules::flake8_pytest_style::helpers::{Parentheses, get_mark_decorator /// import pytest /// /// -/// @pytest.mark.foo +/// @pytest.mark.foo() /// def test_something(): ... /// ``` /// @@ -41,7 +41,7 @@ use crate::rules::flake8_pytest_style::helpers::{Parentheses, get_mark_decorator /// import pytest /// /// -/// @pytest.mark.foo() +/// @pytest.mark.foo /// def test_something(): ... /// ``` ///