This is an automated email from the ASF dual-hosted git repository. potiuk pushed a commit to branch backport-ci-20261025-v3-4-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 0cb6d661e9e459b030ab9ec3f93b54bff098711e Author: Jarek Potiuk <[email protected]> AuthorDate: Sun Oct 25 19:28:29 2026 +0100 Keep a Breeze test's --dry-run from leaking into later tests (#75589) The dry-run, verbose and forced-answer options are process-wide, so a test invoking a command with --dry-run made run_command return empty output for every later test on the same xdist worker. Which tests failed depended on how xdist distributed them, so the Breeze unit tests failed intermittently, as in the scheduled ARM run. Generated-by: Claude Opus 5 (cherry picked from commit 0c1fa8eeb726df9483a64c9a0597d3c36ddad040) --- dev/breeze/tests/conftest.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dev/breeze/tests/conftest.py b/dev/breeze/tests/conftest.py index 57d834359c6..c7cfcd5fa5b 100644 --- a/dev/breeze/tests/conftest.py +++ b/dev/breeze/tests/conftest.py @@ -21,6 +21,7 @@ from pathlib import Path import pytest from airflow_breeze.utils.functools_cache import clear_all_cached_functions +from airflow_breeze.utils.shared_options import _SharedOptions def pytest_configure(config): @@ -86,3 +87,11 @@ def make_worktree(tmp_path): return path return make + + [email protected](autouse=True) +def restore_shared_options(monkeypatch): + # Invoking a command with --dry-run or --verbose sets these for the whole process, so later tests + # on the same xdist worker would run with them, and run_command would return empty output. + for name in ("verbose_value", "dry_run_value", "forced_answer"): + monkeypatch.setattr(_SharedOptions, name, getattr(_SharedOptions, name))
