Skip to content

Commit 8e27123

Browse files
committed
fix: Handle new/old networkx graph emissions
1 parent d986f53 commit 8e27123

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

nipype/pipeline/engine/tests/test_engine.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,9 @@ def test_write_graph_dotfile(tmpdir, graph_type, simple):
541541
pipe.write_graph(graph2use=graph_type, simple_form=simple, format="dot")
542542

543543
with open("graph.dot") as f:
544-
graph_str = f.read()
544+
# Replace handles change in networkx behavior when graph is missing a name
545+
# Probably around 3, but I haven't tracked it down.
546+
graph_str = f.read().replace(' {', ' {')
545547

546548
if simple:
547549
for line in dotfiles[graph_type]:
@@ -635,7 +637,9 @@ def test_write_graph_dotfile_iterables(tmpdir, graph_type, simple):
635637
pipe.write_graph(graph2use=graph_type, simple_form=simple, format="dot")
636638

637639
with open("graph.dot") as f:
638-
graph_str = f.read()
640+
# Replace handles change in networkx behavior when graph is missing a name
641+
# Probably around 3, but I haven't tracked it down.
642+
graph_str = f.read().replace(' {', ' {')
639643

640644
if simple:
641645
for line in dotfiles_iter[graph_type]:

0 commit comments

Comments
 (0)