Don't generate test keys concurrently with xdist. (#7792)

This commit is contained in:
Andrey Rakhmatullin 2026-07-28 12:51:52 +05:00 committed by GitHub
parent f3693aa8ba
commit a5bc43e34c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,6 @@
from __future__ import annotations
import os
from importlib.util import find_spec
from pathlib import Path
from typing import TYPE_CHECKING
@ -135,5 +136,6 @@ def pytest_runtest_setup(item):
pytest.skip("mitmdump is not available")
# Generate localhost certificate files, needed by some tests
generate_keys()
# Generate localhost certificate files, needed by some tests (but only once if xdist is used)
if "PYTEST_XDIST_WORKER" not in os.environ:
generate_keys()