Skip to content

Commit a7c477d

Browse files
authored
Update doctests in validate_graph function
1 parent db16116 commit a7c477d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

graphs/travelling_salesman_problem.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ def validate_graph(graph_points: dict[str, list[float]]) -> None:
4747
...
4848
InvalidGraphError: Each node must have a valid 2D coordinate [x, y]
4949
50-
>>> validate_graph([10, 20]) # Invalid input type
50+
>>> validate_graph([10, 20]) # doctest: +IGNORE_EXCEPTION_DETAIL
5151
Traceback (most recent call last):
5252
...
5353
InvalidGraphError: Graph must be a dictionary with node names and coordinates
5454
55-
>>> validate_graph({"A": [10, 20], "B": [30, 21], "C": [15]}) # Missing coordinate
55+
>>> validate_graph( # doctest: +IGNORE_EXCEPTION_DETAIL
56+
... {"A": [10, 20], "B": [30, 21], "C": [15]}
57+
... ) # Missing coordinate
5658
Traceback (most recent call last):
5759
...
5860
InvalidGraphError: Each node must have a valid 2D coordinate [x, y]

0 commit comments

Comments
 (0)