From 46bc5ab843d9f83d8fa6869ba04de7adc4320dfb Mon Sep 17 00:00:00 2001 From: Carl Smedstad Date: Tue, 4 Jan 2022 14:02:04 +0100 Subject: [PATCH] Unset EDITOR env var in test_run_hook_edit Without this the test will fail if the EDITOR env var is set to something different than 'vim -n'. --- gitlint-core/gitlint/tests/cli/test_cli_hooks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gitlint-core/gitlint/tests/cli/test_cli_hooks.py b/gitlint-core/gitlint/tests/cli/test_cli_hooks.py index 825345f..6cb03de 100644 --- a/gitlint-core/gitlint/tests/cli/test_cli_hooks.py +++ b/gitlint-core/gitlint/tests/cli/test_cli_hooks.py @@ -132,6 +132,8 @@ class CLIHookTests(BaseTestCase): for i in range(0, len(set_editors)): if set_editors[i]: os.environ['EDITOR'] = set_editors[i] + else: + os.environ.pop('EDITOR', None) with self.patch_input(['e', 'e', 'n']): with self.tempdir() as tmpdir: -- 2.34.1