1
0
Fork 0
forked from github/pelican

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.
This commit is contained in:
Ben Sturmfels 2021-10-08 18:47:40 +11:00
commit 793b93bd34
No known key found for this signature in database
GPG key ID: 023C05E2C9C068F0

View file

@ -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()