You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2023/01/10 19:43:48 UTC

[GitHub] [airflow] jedcunningham commented on a diff in pull request #28773: pre-commit check for xfail in unit tests

jedcunningham commented on code in PR #28773:
URL: https://github.com/apache/airflow/pull/28773#discussion_r1066240841


##########
.pre-commit-config.yaml:
##########
@@ -577,6 +577,14 @@ repos:
         files: \.*example_dags.*\.py$
         exclude: ^airflow/_vendor/
         pass_filenames: true
+      - id: check-xfail-usage-in-test-code
+        language: pygrep
+        name: Don't use xfail in tests
+        description: xfail is not recommended as a test meant to fail is generally not meaningful
+        entry: "@pytest.mark.xfail"
+        pass_filenames: true
+        files: ^tests/.*\.py$
+        exclude: ^airflow/|^docs/|^tests/always/test_project_structure.py|^tests/jobs/test_backfill_job.py

Review Comment:
   Why do we need `^airflow` and `^docs` here, if we are only matching `^tests/.*\.py$`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org