From: Matthew Fernandez Date: Mon, 16 Jan 2023 03:24:30 +0000 (-0800) Subject: use 'which' when accessing gv2gxl, gxl2gv in the test suite X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04490d320ee88e508891c73f8fbd3c381f160960;p=graphviz use 'which' when accessing gv2gxl, gxl2gv in the test suite When running the Graphviz test suite on an installation that was built without some optional components, calls to these missing components can incorrectly resolve to those from a prior Graphviz installation that happens to be in your `$PATH`. This issue was partly addressed in 515c86a923601db5cb704da93046800df7da030a. This change takes things further, ensuring that invocations of `gv2gxl` and `gxl2gv` also land on the right version under test. This requires temporarily xfailing the test due to an unrelated issue with these tools. Gitlab: #2201, #2344 --- diff --git a/tests/test_regression.py b/tests/test_regression.py index 51d66d83c..dc90f473d 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -327,6 +327,7 @@ def test_358(): @pytest.mark.skipif(which("gv2gxl") is None or which("gxl2gv") is None, reason="GXL tools not available") +@pytest.mark.xfail() # FIXME: #2344 def test_517(): """ round tripping a graph through gv2gxl should not lose HTML labels @@ -341,11 +342,13 @@ def test_517(): '}' # translate it to GXL - gxl = subprocess.check_output(["gv2gxl"], input=input, + gv2gxl = which("gv2gxl") + gxl = subprocess.check_output([gv2gxl], input=input, universal_newlines=True) # translate this back to Dot - dot_output = subprocess.check_output(["gxl2gv"], input=gxl, + gxl2gv = which("gxl2gv") + dot_output = subprocess.check_output([gxl2gv], input=gxl, universal_newlines=True) # the result should have both expected labels somewhere