[PATCH 2 of 2 stable v3] tests: prevent Git system and global configuration from loading
Manuel Jacob
me at manueljacob.de
Wed Apr 19 22:39:26 UTC 2023
# HG changeset patch
# User Manuel Jacob <me at manueljacob.de>
# Date 1680139355 -7200
# Thu Mar 30 03:22:35 2023 +0200
# Branch stable
# Node ID e9a574cea28a8db42ff6a84a41a91b6cbe336cbc
# Parent 846ca7f28bd40e07c76ed259ce96a31a85d0c4ea
# EXP-Topic tests-git
tests: prevent Git system and global configuration from loading
This reduces differences between different testing environments. Something
similar is already done for Mercurial (in the lines directly above this
change).
Git’s documentation explicitly mentions that passing a value of /dev/null skips
reading the respective file.
diff --git a/kallithea/tests/other/test_vcs_operations.py b/kallithea/tests/other/test_vcs_operations.py
--- a/kallithea/tests/other/test_vcs_operations.py
+++ b/kallithea/tests/other/test_vcs_operations.py
@@ -150,6 +150,8 @@
testenv['LANGUAGE'] = 'en_US:en'
testenv['HGPLAIN'] = ''
testenv['HGRCPATH'] = ''
+ testenv['GIT_CONFIG_SYSTEM'] = '/dev/null'
+ testenv['GIT_CONFIG_GLOBAL'] = '/dev/null'
testenv.update(environ)
p = Popen(command, shell=True, stdout=PIPE, stderr=PIPE, cwd=self.cwd, env=testenv)
stdout, stderr = p.communicate()
More information about the kallithea-general
mailing list