style: Fix all remaining PT
flake8-pytest-style issues
#4452
+16
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Only 10 issues were remaining to enable checking all available ruff rules of the
PT
category.This PR fixes 3 types of issues, and removes unneeded exclusions, as there were no longer issues there.
The only remaining ignores per file are found in
"*/testsuite/**.py" = ["PT009", "PT027"]
and"python/grass/gunittest/case.py" = ["PT009"]
. The first one is because we use unittest-style asserts in our gunittest tests, obviously, and the grass.gunittest.case detects our custom assertions like if they were tests (and not following pytest style assertions), which isn't desirable.That brings us to having all rules of the
PT
category being addressed.