Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable flake8-pytest-style plugin for ruff #2324

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

cutwater
Copy link
Contributor

@cutwater cutwater commented Oct 21, 2024

Warnings fixed:

  • PT003 scope='function' is implied in @pytest.fixture()
  • PT006 Wrong type passed to first argument of @pytest.mark.parametrize; expected tuple
  • PT007 Wrong values type in @pytest.mark.parametrize expected list of tuple
  • PT011 pytest.raises(ValueError) is too broad, set the match parameter or use a more specific exception
  • PT013 Incorrect import of pytest; use import pytest instead
  • PT017 Found assertion on exception e in except block, use pytest.raises() instead
  • PT018 Assertion should be broken down into multiple parts
  • PT021 Use yield instead of request.addfinalizer

Statistics:

26      PT003   [*] pytest-extraneous-scope-function
 5      PT017   [ ] pytest-assert-in-except
 3      PT006   [*] pytest-parametrize-names-wrong-type
 2      PT007   [*] pytest-parametrize-values-wrong-type
 2      PT021   [ ] pytest-fixture-finalizer-callback
 1      PT011   [ ] pytest-raises-too-broad
 1      PT013   [ ] pytest-incorrect-pytest-import
 1      PT018   [ ] pytest-composite-assertion

@cutwater cutwater force-pushed the feature/ruff/flake8-pytest-style branch 5 times, most recently from dc9c9ad to e7107ef Compare October 21, 2024 17:33
Warnings fixed:

* PT003 `scope='function'` is implied in `@pytest.fixture()`
* PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple`
* PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple`
* PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception
* PT013 Incorrect import of `pytest`; use `import pytest` instead
* PT017 Found assertion on exception `e` in `except` block, use `pytest.raises()` instead
* PT018 Assertion should be broken down into multiple parts
* PT021 Use `yield` instead of `request.addfinalizer`

Statistics:

26      PT003   [*] pytest-extraneous-scope-function
 5      PT017   [ ] pytest-assert-in-except
 3      PT006   [*] pytest-parametrize-names-wrong-type
 2      PT007   [*] pytest-parametrize-values-wrong-type
 2      PT021   [ ] pytest-fixture-finalizer-callback
 1      PT011   [ ] pytest-raises-too-broad
 1      PT013   [ ] pytest-incorrect-pytest-import
 1      PT018   [ ] pytest-composite-assertion
@cutwater cutwater force-pushed the feature/ruff/flake8-pytest-style branch from e7107ef to 9e6f9de Compare October 21, 2024 17:33
Copy link

sonarcloud bot commented Oct 21, 2024

@cutwater cutwater marked this pull request as ready for review October 21, 2024 18:11
@cutwater cutwater changed the title [WIP]: Enable flake8-pytest-style plugin for ruff Enable flake8-pytest-style plugin for ruff Oct 21, 2024
@cutwater cutwater merged commit 73b9637 into ansible:master Oct 21, 2024
20 of 21 checks passed
@cutwater cutwater deleted the feature/ruff/flake8-pytest-style branch October 21, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants