Skip to content

Commit dcce554

Browse files
committed
x
1 parent 31fa1f1 commit dcce554

File tree

2 files changed

+14
-24
lines changed

2 files changed

+14
-24
lines changed

libs/core/langchain_core/runnables/graph.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,6 @@ def draw_mermaid(
614614
615615
Returns:
616616
The Mermaid syntax string.
617-
618617
"""
619618
# Import locally to prevent circular import
620619
from langchain_core.runnables.graph_mermaid import draw_mermaid # noqa: PLC0415

libs/core/tests/unit_tests/runnables/test_graph.py

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import contextlib
21
from typing import Any, Optional
32
from unittest.mock import MagicMock, patch
43

@@ -577,12 +576,10 @@ def test_mermaid_base_url_default() -> None:
577576

578577
with patch("requests.get", return_value=mock_response) as mock_get:
579578
# Call the function with base_url=None (default)
580-
# Supress exceptions because we're not interested in the response for this test.
581-
with contextlib.suppress(Exception):
582-
_render_mermaid_using_api(
583-
"graph TD;\n A --> B;",
584-
base_url=None,
585-
)
579+
_render_mermaid_using_api(
580+
"graph TD;\n A --> B;",
581+
base_url=None,
582+
)
586583

587584
# Verify that the URL was constructed with the default base URL
588585
assert mock_get.called
@@ -600,12 +597,10 @@ def test_mermaid_base_url_custom() -> None:
600597

601598
with patch("requests.get", return_value=mock_response) as mock_get:
602599
# Call the function with custom base_url.
603-
# Supress exceptions because we're not interested in the response for this test.
604-
with contextlib.suppress(Exception):
605-
_render_mermaid_using_api(
606-
"graph TD;\n A --> B;",
607-
base_url=custom_url,
608-
)
600+
_render_mermaid_using_api(
601+
"graph TD;\n A --> B;",
602+
base_url=custom_url,
603+
)
609604

610605
# Verify that the URL was constructed with our custom base URL
611606
assert mock_get.called
@@ -623,12 +618,11 @@ def test_draw_mermaid_png_function_base_url() -> None:
623618

624619
with patch("requests.get", return_value=mock_response) as mock_get:
625620
# Call draw_mermaid_png with custom base_url
626-
with contextlib.suppress(Exception):
627-
draw_mermaid_png(
628-
"graph TD;\n A --> B;",
629-
draw_method=MermaidDrawMethod.API,
630-
base_url=custom_url,
631-
)
621+
draw_mermaid_png(
622+
"graph TD;\n A --> B;",
623+
draw_method=MermaidDrawMethod.API,
624+
base_url=custom_url,
625+
)
632626

633627
# Verify that the URL was constructed with our custom base URL
634628
assert mock_get.called
@@ -652,10 +646,7 @@ def test_graph_draw_mermaid_png_base_url() -> None:
652646
graph.add_edge(start_node, end_node)
653647

654648
# Call draw_mermaid_png with custom base_url
655-
with contextlib.suppress(Exception):
656-
graph.draw_mermaid_png(
657-
draw_method=MermaidDrawMethod.API, base_url=custom_url
658-
)
649+
graph.draw_mermaid_png(draw_method=MermaidDrawMethod.API, base_url=custom_url)
659650

660651
# Verify that the URL was constructed with our custom base URL
661652
assert mock_get.called

0 commit comments

Comments
 (0)