[PATCH 2 of 2] tests: prevent Git system and global configuration from loading

Manuel Jacob me at manueljacob.de
Thu Mar 30 01:37:58 UTC 2023


# HG changeset patch
# User Manuel Jacob <me at manueljacob.de>
# Date 1680139355 -7200
#      Thu Mar 30 03:22:35 2023 +0200
# Node ID 4933600c49883dfc142f97a32dd08f9dd82b0d31
# Parent  2304f8da62b03f6cfd966b72eec70c38c4d52e37
# 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).

The parent changeset has originally been added to support user.useconfigonly. With this changeset, the original motivation for it becomes obsolete. However, it is still necessary to set the committer name via a environment variable, at least on my machine.

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'] = ''
+        testenv['GIT_CONFIG_GLOBAL'] = ''
         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