You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ta...@apache.org on 2024/03/25 19:41:11 UTC

(airflow) 01/01: Suppress error if no tests collected

This is an automated email from the ASF dual-hosted git repository.

taragolis pushed a commit to branch suppress-no-tests-collected
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit c7101e88d8de387a517316ddaffac068ca46a8c9
Author: Andrey Anshin <An...@taragol.is>
AuthorDate: Mon Mar 25 23:38:59 2024 +0400

    Suppress error if no tests collected
---
 dev/breeze/src/airflow_breeze/utils/run_tests.py | 4 ++++
 hatch_build.py                                   | 1 +
 2 files changed, 5 insertions(+)

diff --git a/dev/breeze/src/airflow_breeze/utils/run_tests.py b/dev/breeze/src/airflow_breeze/utils/run_tests.py
index 3abd58aec7..2ce189a401 100644
--- a/dev/breeze/src/airflow_breeze/utils/run_tests.py
+++ b/dev/breeze/src/airflow_breeze/utils/run_tests.py
@@ -394,6 +394,10 @@ def generate_args_for_pytest(
                 "--disable-warnings",
             ]
         )
+    else:
+        # Avoid edge cases when there are no available tests, e.g. No-Pydantic for Weaviate provider.
+        # https://docs.pytest.org/en/stable/reference/exit-codes.html
+        args.append("--suppress-no-test-exit-code")
     return args
 
 
diff --git a/hatch_build.py b/hatch_build.py
index 294e6073f5..8e1dccc1bc 100644
--- a/hatch_build.py
+++ b/hatch_build.py
@@ -255,6 +255,7 @@ DEVEL_EXTRAS: dict[str, list[str]] = {
         "coverage>=7.4.0",
         "pytest-asyncio>=0.23.3",
         "pytest-cov>=4.1.0",
+        "pytest-custom-exit-code>=0.3.0",
         "pytest-icdiff>=0.9",
         "pytest-instafail>=0.5.0",
         "pytest-mock>=3.12.0",