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