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

Deprecate PT004 and PT005 #12837

Merged
merged 3 commits into from
Aug 12, 2024
Merged

Deprecate PT004 and PT005 #12837

merged 3 commits into from
Aug 12, 2024

Conversation

MichaReiser
Copy link
Member

Summary

Deprecates the pytest rules PT004 and PT005.

See #8796

@MichaReiser MichaReiser added the breaking Breaking API change label Aug 12, 2024
Copy link
Contributor

github-actions bot commented Aug 12, 2024

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+0 -356 violations, +0 -0 fixes in 3 projects; 51 projects unchanged)

apache/airflow (+0 -316 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --no-preview --select ALL

- helm_tests/airflow_aux/test_pod_template_file.py:48:9: PT004 Fixture `setup_test_cases` does not return anything, add leading underscore
- kubernetes_tests/conftest.py:27:5: PT004 Fixture `initialize_providers_manager` does not return anything, add leading underscore
- kubernetes_tests/test_base.py:58:9: PT004 Fixture `base_tests_setup` does not return anything, add leading underscore
- kubernetes_tests/test_kubernetes_pod_operator.py:89:5: PT004 Fixture `mock_get_connection` does not return anything, add leading underscore
- kubernetes_tests/test_kubernetes_pod_operator.py:98:9: PT004 Fixture `setup_tests` does not return anything, add leading underscore
- tests/always/test_pandas.py:31:9: PT004 Fixture `setup_test_cases` does not return anything, add leading underscore
- tests/always/test_pandas.py:48:9: PT004 Fixture `setup_test_cases` does not return anything, add leading underscore
- tests/always/test_providers_manager.py:57:9: PT004 Fixture `inject_fixtures` does not return anything, add leading underscore
- tests/api_connexion/conftest.py:64:5: PT004 Fixture `set_auto_role_public` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_config_endpoint.py:238:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_config_endpoint.py:70:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_connection_endpoint.py:61:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dag_endpoint.py:122:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dag_parsing.py:67:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dag_run_endpoint.py:132:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dag_source_endpoint.py:74:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dag_stats_endpoint.py:62:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dag_warning_endpoint.py:67:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dataset_endpoint.py:655:9: PT004 Fixture `time_freezer` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dataset_endpoint.py:835:9: PT004 Fixture `time_freezer` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dataset_endpoint.py:84:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_event_log_endpoint.py:102:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_extra_link_endpoint.py:67:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
... 293 additional changes omitted for rule PT004
- tests/providers/ssh/operators/test_ssh.py:68:9: PT005 Fixture `_patch_exec_ssh_client` returns a value, remove leading underscore
... 292 additional changes omitted for project

apache/superset (+0 -40 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --no-preview --select ALL

- tests/integration_tests/celery_tests.py:71:5: PT004 Fixture `setup_sqllab` does not return anything, add leading underscore
- tests/integration_tests/charts/api_tests.py:1274:9: PT004 Fixture `load_energy_charts` does not return anything, add leading underscore
- tests/integration_tests/charts/api_tests.py:89:9: PT004 Fixture `clear_data_cache` does not return anything, add leading underscore
- tests/integration_tests/charts/data/api_tests.py:93:5: PT004 Fixture `skip_by_backend` does not return anything, add leading underscore
- tests/integration_tests/conftest.py:120:5: PT004 Fixture `setup_sample_data` does not return anything, add leading underscore
- tests/integration_tests/core_tests.py:79:5: PT004 Fixture `cleanup` does not return anything, add leading underscore
- tests/integration_tests/dashboards/filter_state/api_tests.py:57:5: PT004 Fixture `cache` does not return anything, add leading underscore
- tests/integration_tests/explore/api_tests.py:66:5: PT004 Fixture `cache` does not return anything, add leading underscore
- tests/integration_tests/explore/form_data/api_tests.py:68:5: PT004 Fixture `cache` does not return anything, add leading underscore
- tests/integration_tests/fixtures/birth_names_dashboard.py:37:5: PT004 Fixture `load_birth_names_data` does not return anything, add leading underscore
... 30 additional changes omitted for project

agronholm/anyio (+0 -0 violations, +0 -0 fixes)


Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
PT004 355 0 355 0 0
PT005 1 0 1 0 0

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+4 -356 violations, +0 -0 fixes in 4 projects; 50 projects unchanged)

apache/airflow (+0 -316 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

- helm_tests/airflow_aux/test_pod_template_file.py:48:9: PT004 Fixture `setup_test_cases` does not return anything, add leading underscore
- kubernetes_tests/conftest.py:27:5: PT004 Fixture `initialize_providers_manager` does not return anything, add leading underscore
- kubernetes_tests/test_base.py:58:9: PT004 Fixture `base_tests_setup` does not return anything, add leading underscore
- kubernetes_tests/test_kubernetes_pod_operator.py:89:5: PT004 Fixture `mock_get_connection` does not return anything, add leading underscore
- kubernetes_tests/test_kubernetes_pod_operator.py:98:9: PT004 Fixture `setup_tests` does not return anything, add leading underscore
- tests/always/test_pandas.py:31:9: PT004 Fixture `setup_test_cases` does not return anything, add leading underscore
- tests/always/test_pandas.py:48:9: PT004 Fixture `setup_test_cases` does not return anything, add leading underscore
- tests/always/test_providers_manager.py:57:9: PT004 Fixture `inject_fixtures` does not return anything, add leading underscore
- tests/api_connexion/conftest.py:64:5: PT004 Fixture `set_auto_role_public` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_config_endpoint.py:238:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_config_endpoint.py:70:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_connection_endpoint.py:61:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dag_endpoint.py:122:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dag_parsing.py:67:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dag_run_endpoint.py:132:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dag_source_endpoint.py:74:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dag_stats_endpoint.py:62:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dag_warning_endpoint.py:67:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dataset_endpoint.py:655:9: PT004 Fixture `time_freezer` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dataset_endpoint.py:835:9: PT004 Fixture `time_freezer` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_dataset_endpoint.py:84:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
- tests/api_connexion/endpoints/test_event_log_endpoint.py:102:9: PT004 Fixture `setup_attrs` does not return anything, add leading underscore
... 294 additional changes omitted for rule PT004
- tests/providers/ssh/operators/test_ssh.py:68:9: PT005 Fixture `_patch_exec_ssh_client` returns a value, remove leading underscore
... 293 additional changes omitted for project

apache/superset (+0 -40 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

- tests/integration_tests/celery_tests.py:71:5: PT004 Fixture `setup_sqllab` does not return anything, add leading underscore
- tests/integration_tests/charts/api_tests.py:1274:9: PT004 Fixture `load_energy_charts` does not return anything, add leading underscore
- tests/integration_tests/charts/api_tests.py:89:9: PT004 Fixture `clear_data_cache` does not return anything, add leading underscore
- tests/integration_tests/charts/data/api_tests.py:93:5: PT004 Fixture `skip_by_backend` does not return anything, add leading underscore
- tests/integration_tests/conftest.py:120:5: PT004 Fixture `setup_sample_data` does not return anything, add leading underscore
- tests/integration_tests/core_tests.py:79:5: PT004 Fixture `cleanup` does not return anything, add leading underscore
- tests/integration_tests/dashboards/filter_state/api_tests.py:57:5: PT004 Fixture `cache` does not return anything, add leading underscore
- tests/integration_tests/explore/api_tests.py:66:5: PT004 Fixture `cache` does not return anything, add leading underscore
- tests/integration_tests/explore/form_data/api_tests.py:68:5: PT004 Fixture `cache` does not return anything, add leading underscore
- tests/integration_tests/fixtures/birth_names_dashboard.py:37:5: PT004 Fixture `load_birth_names_data` does not return anything, add leading underscore
... 30 additional changes omitted for project

freedomofpress/securedrop (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ molecule/testinfra/ossec/test_journalist_mail.py:14:45: RUF100 [*] Unused `noqa` directive (non-enabled: `PT004`)

rotki/rotki (+3 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ rotkehlchen/tests/fixtures/globaldb.py:200:52: RUF100 [*] Unused `noqa` directive (non-enabled: `PT004`)
+ rotkehlchen/tests/fixtures/oracles.py:20:118: RUF100 [*] Unused `noqa` directive (non-enabled: `PT004`)
+ rotkehlchen/tests/fixtures/thegraph.py:12:67: RUF100 [*] Unused `noqa` directive (non-enabled: `PT004`)

Changes by rule (3 rules affected)

code total + violation - violation + fix - fix
PT004 355 0 355 0 0
RUF100 4 4 0 0 0
PT005 1 0 1 0 0

MichaReiser and others added 2 commits August 12, 2024 16:04
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@MichaReiser MichaReiser merged commit b53cc11 into ruff-0.6 Aug 12, 2024
20 checks passed
@MichaReiser MichaReiser deleted the deprecate-pt004-pt005 branch August 12, 2024 14:13
@MichaReiser MichaReiser mentioned this pull request Aug 13, 2024
AlexWaygood added a commit that referenced this pull request Aug 14, 2024
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
MichaReiser added a commit that referenced this pull request Aug 14, 2024
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
MichaReiser added a commit that referenced this pull request Aug 14, 2024
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking API change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants