diff --git a/tests/tools/visualization/test_graph.py b/tests/tools/visualization/test_graph.py index ba47b335b2..6ffe491420 100644 --- a/tests/tools/visualization/test_graph.py +++ b/tests/tools/visualization/test_graph.py @@ -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)