From: Magnus Jacobsson Date: Tue, 29 Sep 2020 09:39:53 +0000 (+0200) Subject: Unset the DISPLAY environment variable in tools test X-Git-Tag: 2.46.0~20^2^2~47^2~70 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5944d785af5a983ac65b7d09ae52b395df7df6dd;p=graphviz Unset the DISPLAY environment variable in tools test This ensures that the test fails instead of hanging if print usage and exit fails and the program continues and tries to open the display. --- diff --git a/rtest/test_tools.py b/rtest/test_tools.py index e4beca204..dafbcf4f9 100644 --- a/rtest/test_tools.py +++ b/rtest/test_tools.py @@ -141,9 +141,14 @@ def test_tools(tool): pytest.skip('gvpack does not find libgvplugin_neato_layout.so.6' 'when built with CMake (#1838)') + # Ensure that X fails to open display + environ_copy = os.environ.copy() + environ_copy.pop('DISPLAY', None) + # Test usage output = subprocess.check_output( [tool, '-?'], + env=environ_copy, stdin=subprocess.DEVNULL, stderr=subprocess.STDOUT, universal_newlines=True,