Skip to content

Commit

Permalink
Skip profiler test segment that relies on graphviz
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Paine <[email protected]>
  • Loading branch information
timkpaine committed Feb 8, 2024
1 parent 1639530 commit 7311025
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions csp/tests/test_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from csp import profiler, ts
from csp.tests.test_dynamic import DynData, gen_basket, random_keys

from .test_showgraph import _cant_find_graphviz


@csp.graph
def stats_graph():
Expand Down Expand Up @@ -153,9 +155,10 @@ def graph3():

with profiler.Profiler() as p:
results = csp.run(graph3, starttime=st, endtime=st + timedelta(seconds=100))
with tempfile.NamedTemporaryFile(prefix="foo", suffix=".png", mode="w") as temp_file:
temp_file.close()
csp.show_graph(graph3, graph_filename=temp_file.name)
if not _cant_find_graphviz():
with tempfile.NamedTemporaryFile(prefix="foo", suffix=".png", mode="w") as temp_file:
temp_file.close()
csp.show_graph(graph3, graph_filename=temp_file.name)

prof = p.results()
self.assertEqual(prof.cycle_count, 100)
Expand Down

0 comments on commit 7311025

Please sign in to comment.