From fd016987a31af87ba0b0c1108d194c00f1a26858 Mon Sep 17 00:00:00 2001 From: Andrii V Date: Fri, 27 Jun 2025 20:52:31 +0200 Subject: [PATCH] tests: fix 1 more, issue with git directories config --- rhodecode/tests/fixtures/fixture_utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rhodecode/tests/fixtures/fixture_utils.py b/rhodecode/tests/fixtures/fixture_utils.py index 9599e549..8dad2c38 100644 --- a/rhodecode/tests/fixtures/fixture_utils.py +++ b/rhodecode/tests/fixtures/fixture_utils.py @@ -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