Skip to content

Commit

Permalink
Replace string and then sort for graph node string tests
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Nov 29, 2024
1 parent 39d083f commit b832d6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/tools/visualization/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ def test_graph_node_identifiers(self, node_id_type, monkeypatch, file_regression
# The order of certain output lines can be randomly ordered so we split the file in lines, sort, and then join
# them into a single string again. The node identifiers generated by the engine are of the form ``N{pk}`` and
# they also clearly vary, so they are replaced with the ``NODE`` placeholder.
string = '\n'.join(sorted(graph.graphviz.source.strip().split('\n')))
string = graph.graphviz.source
string = re.sub(r'N\d+', 'NODE', string)
string = '\n'.join(sorted(string.strip().split('\n')))
file_regression.check(string)

0 comments on commit b832d6a

Please sign in to comment.