Remove @ in pytest.mark.parametrize rule messages#14770
Merged
MichaReiser merged 2 commits intoastral-sh:mainfrom Dec 4, 2024
Merged
Remove @ in pytest.mark.parametrize rule messages#14770MichaReiser merged 2 commits intoastral-sh:mainfrom
@ in pytest.mark.parametrize rule messages#14770MichaReiser merged 2 commits intoastral-sh:mainfrom
Conversation
harupy
commented
Dec 4, 2024
| } | ||
| }; | ||
| format!("Wrong type passed to first argument of `@pytest.mark.parametrize`; expected {expected_string}") | ||
| format!("Wrong type passed to first argument of `pytest.mark.parametrize`; expected {expected_string}") |
Contributor
Author
There was a problem hiding this comment.
flake8-pytest-style uses @pytest.mark.parametrize:
Member
|
Removing it makes sense to me |
Contributor
Author
Thanks for the comment. |
Contributor
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| PT006 | 2704 | 1352 | 1352 | 0 | 0 |
| PT007 | 626 | 313 | 313 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+1715 -1715 violations, +0 -0 fixes in 4 projects; 51 projects unchanged)
apache/airflow (+1550 -1550 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
- dev/breeze/tests/test_cache.py:35:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + dev/breeze/tests/test_cache.py:35:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - dev/breeze/tests/test_docker_command_utils.py:203:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + dev/breeze/tests/test_docker_command_utils.py:203:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - dev/breeze/tests/test_exclude_from_matrix.py:25:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + dev/breeze/tests/test_exclude_from_matrix.py:25:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - dev/breeze/tests/test_general_utils.py:25:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + dev/breeze/tests/test_general_utils.py:25:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - dev/breeze/tests/test_packages.py:126:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + dev/breeze/tests/test_packages.py:126:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - dev/breeze/tests/test_packages.py:164:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + dev/breeze/tests/test_packages.py:164:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - dev/breeze/tests/test_packages.py:238:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + dev/breeze/tests/test_packages.py:238:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - dev/breeze/tests/test_packages.py:340:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + dev/breeze/tests/test_packages.py:340:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - dev/breeze/tests/test_packages.py:351:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + dev/breeze/tests/test_packages.py:351:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - dev/breeze/tests/test_packages.py:362:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + dev/breeze/tests/test_packages.py:362:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - dev/breeze/tests/test_packages.py:402:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + dev/breeze/tests/test_packages.py:402:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - dev/breeze/tests/test_packages.py:438:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` ... 2484 additional changes omitted for rule PT006 - providers/tests/amazon/aws/assets/test_s3.py:75:33: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` + providers/tests/amazon/aws/assets/test_s3.py:75:33: PT007 Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple` - providers/tests/amazon/aws/hooks/test_base_aws.py:463:99: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` + providers/tests/amazon/aws/hooks/test_base_aws.py:463:99: PT007 Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple` - providers/tests/amazon/aws/hooks/test_eks.py:1203:13: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` + providers/tests/amazon/aws/hooks/test_eks.py:1203:13: PT007 Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple` - providers/tests/amazon/aws/hooks/test_eks.py:1215:13: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` + providers/tests/amazon/aws/hooks/test_eks.py:1215:13: PT007 Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple` - providers/tests/amazon/aws/hooks/test_eks.py:1227:13: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` + providers/tests/amazon/aws/hooks/test_eks.py:1227:13: PT007 Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple` - providers/tests/amazon/aws/hooks/test_redshift_data.py:452:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` + providers/tests/amazon/aws/hooks/test_redshift_data.py:452:9: PT007 Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple` - providers/tests/amazon/aws/operators/test_ecs.py:197:13: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` + providers/tests/amazon/aws/operators/test_ecs.py:197:13: PT007 Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple` - providers/tests/amazon/aws/operators/test_ecs.py:205:13: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` + providers/tests/amazon/aws/operators/test_ecs.py:205:13: PT007 Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple` - providers/tests/amazon/aws/operators/test_ecs.py:213:13: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` + providers/tests/amazon/aws/operators/test_ecs.py:213:13: PT007 Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple` - providers/tests/amazon/aws/operators/test_ecs.py:221:13: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` + providers/tests/amazon/aws/operators/test_ecs.py:221:13: PT007 Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple` - providers/tests/amazon/aws/operators/test_ecs.py:229:13: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` + providers/tests/amazon/aws/operators/test_ecs.py:229:13: PT007 Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple` ... 3055 additional changes omitted for project
apache/superset (+136 -136 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
- tests/integration_tests/access_tests.py:84:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + tests/integration_tests/access_tests.py:84:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - tests/integration_tests/charts/data/api_tests.py:1458:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + tests/integration_tests/charts/data/api_tests.py:1458:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - tests/integration_tests/charts/data/api_tests.py:1483:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + tests/integration_tests/charts/data/api_tests.py:1483:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - tests/integration_tests/db_engine_specs/hive_tests.py:234:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + tests/integration_tests/db_engine_specs/hive_tests.py:234:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - tests/integration_tests/extensions/metastore_cache_test.py:102:5: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + tests/integration_tests/extensions/metastore_cache_test.py:102:5: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` ... 262 additional changes omitted for project
bokeh/bokeh (+27 -27 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
- tests/unit/bokeh/colors/test_named.py:184:26: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + tests/unit/bokeh/colors/test_named.py:184:26: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - tests/unit/bokeh/core/property/test_validation__property.py:195:30: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + tests/unit/bokeh/core/property/test_validation__property.py:195:30: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - tests/unit/bokeh/core/property/test_validation__property.py:196:30: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + tests/unit/bokeh/core/property/test_validation__property.py:196:30: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` ... 15 additional changes omitted for rule PT006 - tests/unit/bokeh/core/property/test_visual.py:237:37: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` + tests/unit/bokeh/core/property/test_visual.py:237:37: PT007 Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple` - tests/unit/bokeh/core/property/test_visual.py:308:37: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` + tests/unit/bokeh/core/property/test_visual.py:308:37: PT007 Wrong values type in `pytest.mark.parametrize` expected `list` of `tuple` ... 44 additional changes omitted for project
pypa/setuptools (+2 -2 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
- pkg_resources/tests/test_working_set.py:107:9: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + pkg_resources/tests/test_working_set.py:107:9: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple` - setuptools/tests/test_egg_info.py:308:17: PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple` + setuptools/tests/test_egg_info.py:308:17: PT006 Wrong type passed to first argument of `pytest.mark.parametrize`; expected `tuple`
Changes by rule (2 rules affected)
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| PT006 | 2802 | 1401 | 1401 | 0 | 0 |
| PT007 | 628 | 314 | 314 | 0 | 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Related to #14515. The rules for
pytest.mark.parametrizecheck calls now, not decorators.@in the message can be removed.Test Plan
Existing tests