diff --git a/tests/digraph/test_is_semi_connected.py b/tests/digraph/test_is_semi_connected.py index 2cb909d28..1382845ea 100644 --- a/tests/digraph/test_is_semi_connected.py +++ b/tests/digraph/test_is_semi_connected.py @@ -72,5 +72,5 @@ def test_is_semi_connected_directed_star_graph(self): self.assertEqual(rustworkx.is_semi_connected(graph), naive_semi_connected(graph)) def test_is_semi_connected_directed_grid_graph(self): - graph = rustworkx.generators.directed_grid_graph(50, 50) + graph = rustworkx.generators.directed_grid_graph(10, 10) self.assertEqual(rustworkx.is_semi_connected(graph), naive_semi_connected(graph)) diff --git a/tests/graph/test_coloring.py b/tests/graph/test_coloring.py index 1899be756..1fb884ac8 100644 --- a/tests/graph/test_coloring.py +++ b/tests/graph/test_coloring.py @@ -214,7 +214,6 @@ def preset(edge_idx): with self.subTest(): edge_colors = rustworkx.graph_greedy_edge_color(graph, preset_color_fn=preset) - print(f"{edge_colors = }") self.assertEqual({0: 1, 1: 2, 2: 0, 3: 0, 4: 2, 5: 1}, edge_colors) with self.subTest(strategy=rustworkx.ColoringStrategy.Degree): diff --git a/tests/graph/test_max_weight_matching.py b/tests/graph/test_max_weight_matching.py index f95860cf1..1b07a2eeb 100644 --- a/tests/graph/test_max_weight_matching.py +++ b/tests/graph/test_max_weight_matching.py @@ -52,13 +52,6 @@ def get_nx_weight(edge): for (u, v) in rx_matches: if (u, v) not in nx_matches: if (v, u) not in nx_matches: - print( - f"seed {seed} failed. Element {(u, v)} and it's " - f"reverse {(v, u)} not found in networkx output.\nrustworkx" - f" output: {rx_matches}\nnetworkx output: {nx_matches}" - f"\nedge list: {list(rx_graph.weighted_edge_list())}\n" - "falling back to checking for a valid solution" - ) not_match = True break if not_match: diff --git a/tests/visualization/test_graphviz.py b/tests/visualization/test_graphviz.py index 4a6a472dc..e722d7e33 100644 --- a/tests/visualization/test_graphviz.py +++ b/tests/visualization/test_graphviz.py @@ -166,19 +166,20 @@ def test_escape_sequences(self): } for escaped_seq, raw_seq in escape_sequences.items(): - - def node_attr(node): - """ - Define node attributes including escape sequences for labels and tooltips. - """ - label = f"label{escaped_seq}" - tooltip = f"tooltip{escaped_seq}" - return {"label": label, "tooltip": tooltip} - - # Draw the graph using graphviz_draw - dot_str = graph.to_dot(node_attr) - - # Assert that the escape sequences are correctly placed and escaped in the dot string - self.assertIn( - escaped_seq, dot_str, f"Escape sequence {escaped_seq} not found in dot output" - ) + with self.subTest(chr=ord(raw_seq)): + + def node_attr(node): + """ + Define node attributes including escape sequences for labels and tooltips. + """ + label = f"label{escaped_seq}" + tooltip = f"tooltip{escaped_seq}" + return {"label": label, "tooltip": tooltip} + + # Draw the graph using graphviz_draw + dot_str = graph.to_dot(node_attr) + + # Assert that the escape sequences are correctly placed and escaped in the dot string + self.assertIn( + escaped_seq, dot_str, f"Escape sequence {escaped_seq} not found in dot output" + )