tests: fix 1 more, issue with git directories config

This commit is contained in:
Andrii V 2025-06-27 20:52:31 +02:00
parent 22e865578e
commit fd016987a3

View file

@ -289,6 +289,16 @@ def tests_tmp_path(request):
if not os.path.exists(TESTS_TMP_PATH):
os.makedirs(TESTS_TMP_PATH)
# Sometimes git is upset about "suspicious directory" which interferes with tests
import subprocess
try:
subprocess.run(
["git", "config", "--global", "--add", "safe.directory", TESTS_TMP_PATH], check=False, capture_output=True
)
except Exception:
pass
if not request.config.getoption("--keep-tmp-path"):
@request.addfinalizer