From 943cba6df12c7c9b61f027aad6ce802b210826bc Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Tue, 6 Feb 2024 15:25:49 -0500 Subject: [PATCH] Skip graphviz tests if not installed locally Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- csp/tests/test_showgraph.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/csp/tests/test_showgraph.py b/csp/tests/test_showgraph.py index f32a0ce8f..b603f46cd 100644 --- a/csp/tests/test_showgraph.py +++ b/csp/tests/test_showgraph.py @@ -1,7 +1,20 @@ +import pytest + import csp from csp.showgraph import _build_graphviz_graph +def _cant_find_graphviz(): + try: + from graphviz import Digraph + + Digraph().pipe() + except BaseException: + return True + return False + + +@pytest.mark.skipif(_cant_find_graphviz(), reason="cannot find graphviz installation") def test_showgraph_names(): # Simple test to assert that node names # are properly propagated into graph viewer