From 793b93bd3441edf848dc4a765db18fcaf0640438 Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Fri, 8 Oct 2021 18:47:40 +1100 Subject: [PATCH] Use `--no-pager` option rather than override all environment variables Currently the `assertDirsEqual` test utility uses the `env` argument to `subprocess.Popen` to make git run non-interactively, but this overwrites all environment variables causing test failures on Guix. The `--no-pager` option is a more targeted way to achieve the same thing. --- pelican/tests/test_pelican.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index cacc65c1..389dbb3d 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -56,9 +56,8 @@ class TestPelican(LoggedTestCase): def assertDirsEqual(self, left_path, right_path): out, err = subprocess.Popen( - ['git', 'diff', '--no-ext-diff', '--exit-code', + ['git', '--no-pager', 'diff', '--no-ext-diff', '--exit-code', '-w', left_path, right_path], - env={'PAGER': ''}, stdout=subprocess.PIPE, stderr=subprocess.PIPE ).communicate()