From 650f3cf6e10a01fbe6ffedc373967fa7e2957b6c Mon Sep 17 00:00:00 2001 From: "Ajmera, Mahita SI/HZR-IDSA" Date: Thu, 17 Oct 2024 10:13:46 +0200 Subject: [PATCH] capturing print output --- graphs/tests/test_graphs_floyd_warshall.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/graphs/tests/test_graphs_floyd_warshall.py b/graphs/tests/test_graphs_floyd_warshall.py index f87843112..aae312aac 100644 --- a/graphs/tests/test_graphs_floyd_warshall.py +++ b/graphs/tests/test_graphs_floyd_warshall.py @@ -18,7 +18,7 @@ def test_no_edges(): assert dist == expected -def test_example_input(): +def test_example_input(capsys): num_vertices = 3 graph = [ [float("inf"), float("inf"), float("inf")], @@ -35,13 +35,10 @@ def test_example_input(): [float("inf"), float("inf"), 0], ] dist, _ = floyd_warshall(graph, num_vertices) + _ = capsys.readouterr() assert dist == expected -if __name__ == "__main__": - pytest.main() - - def test_unreachable_vertices(): graph = [ [0, 1, float("inf")],