Skip to content

Commit 70f5105

Browse files
authored
Remove assert from doctests
1 parent 255832d commit 70f5105

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

graphs/breadth_first_search_shortest_path.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ def shortest_path(self, target_vertex: str) -> str:
5353
>>> g.breath_first_search()
5454
5555
Case 1 - No path is found.
56-
>>> assert(g.shortest_path("Foo") == "No path from vertex:G to vertex:Foo")
57-
56+
>>> g.shortest_path("Foo")
57+
'No path from vertex:G to vertex:Foo'
5858
Case 2 - The path is found.
59-
>>> assert(g.shortest_path("D") == "G->C->A->B->D")
60-
>>> assert(g.shortest_path("G") == "G")
59+
>>> g.shortest_path("D")
60+
'G->C->A->B->D'
61+
>>> g.shortest_path("G")
62+
'G'
6163
"""
6264
if target_vertex == self.source_vertex:
6365
return f"{self.source_vertex}"

0 commit comments

Comments
 (0)