-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Closed
Copy link
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violationshelp wantedContributions especially welcomeContributions especially welcome
Description
Summary
With PT001 on default no-parenthesis mode, it deletes comments inside the parenthesis playground
I'm not sure if this is an actual concern since I'm not too familiar with pytest, but I can imagine a case where this could be undesirable: If all parameters were commented out for whatever reason, and it gets removed by CI. I'm not sure if you would ever encounter this while actually using pytest.
PS ~\Desktop\New_folder>Get-Content issue.py
import pytest
@pytest.fixture(
# TODO: use module scope
# scope="module"
)
def my_fixture(): ...PS ~\Desktop\New_folder>uvx ruff check issue.py --select PT --fix --diff
--- issue.py
+++ issue.py
@@ -1,7 +1,4 @@
import pytest
-@pytest.fixture(
- # TODO: use module scope
- # scope="module"
-)
+@pytest.fixture
def my_fixture(): ...
Would fix 1 error.All of this also applies to PT023 playground
Version
ruff 0.12.0 (87f0feb 2025-06-17) + playground
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violationshelp wantedContributions especially welcomeContributions especially welcome