Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@
from tests_common.test_utils.config import conf_vars


@pytest.fixture(autouse=True)
def isolated_password_file(tmp_path):
"""
Point the SimpleAuthManager generated-password file at a per-test path.

By default the file lives under ``AIRFLOW_HOME``, a single path shared by every
test process. Fixtures and tests here create, overwrite, and delete it, so under
parallel (xdist) runs one process can delete the file another is mid-read on,
raising ``FileNotFoundError``. Giving each test its own ``tmp_path`` file removes
that cross-process race.
"""
password_file = tmp_path / "simple_auth_manager_passwords.json.generated"
with conf_vars({("core", "simple_auth_manager_passwords_file"): str(password_file)}):
yield


@pytest.fixture
def auth_manager():
auth_manager = SimpleAuthManager()
Expand Down
Loading