-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove @
in pytest.mark.parametrize
rule messages
#14770
Conversation
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}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flake8-pytest-style
uses @pytest.mark.parametrize
:
Removing it makes sense to me |
Thanks for the comment. |
|
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Summary
Related to #14515. The rules for
pytest.mark.parametrize
check calls now, not decorators.@
in the message can be removed.Test Plan
Existing tests