From 216b7e8ecfd45c849730dab41aaa2877b7dbe61f Mon Sep 17 00:00:00 2001 From: SystemSolution21 <156997764+SystemSolution21@users.noreply.github.com> Date: Wed, 3 Sep 2025 14:45:55 +0900 Subject: [PATCH 1/2] Added pytest failure statement in pytest.yaml --- .github/workflows/pytest.yaml | 4 ++++ .../5_agents_tools/tests/test_agent_tools_basic.py | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index d66420f..165b946 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -31,6 +31,10 @@ jobs: - name: Run pytest run: pytest + - name: Failure log + if: failure() + run: echo "1つ前のステップは失敗しました!" + - name: Print secrets run: echo "TEST_API_KEY -> ${{secrets.TEST_API_KEY}}" diff --git a/langchain-crash-course/5_agents_tools/tests/test_agent_tools_basic.py b/langchain-crash-course/5_agents_tools/tests/test_agent_tools_basic.py index 2d2dd34..15c8571 100644 --- a/langchain-crash-course/5_agents_tools/tests/test_agent_tools_basic.py +++ b/langchain-crash-course/5_agents_tools/tests/test_agent_tools_basic.py @@ -71,7 +71,10 @@ def test_tools_list_contains_current_time(agent_module): assert isinstance(tools, list) # Find tool by name names = [tool.name for tool in tools] - assert "Current Time" in names, f"Tool 'Current Time' not found in {names}" + # assert "Current Time" in names, f"Tool 'Current Time' not found in {names}" + assert "Current" in names, ( + f"Tool 'Current Time' not found in {names}" + ) # pytest fails can also confirm on Github Actions def test_module_import_with_missing_llm(monkeypatch): From 41c98e1aee267bc022df2965d3bf88017b9074cd Mon Sep 17 00:00:00 2001 From: SystemSolution21 <156997764+SystemSolution21@users.noreply.github.com> Date: Wed, 3 Sep 2025 14:52:59 +0900 Subject: [PATCH 2/2] Resolved pytest fail --- .../5_agents_tools/tests/test_agent_tools_basic.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/langchain-crash-course/5_agents_tools/tests/test_agent_tools_basic.py b/langchain-crash-course/5_agents_tools/tests/test_agent_tools_basic.py index 15c8571..22d9583 100644 --- a/langchain-crash-course/5_agents_tools/tests/test_agent_tools_basic.py +++ b/langchain-crash-course/5_agents_tools/tests/test_agent_tools_basic.py @@ -71,10 +71,10 @@ def test_tools_list_contains_current_time(agent_module): assert isinstance(tools, list) # Find tool by name names = [tool.name for tool in tools] - # assert "Current Time" in names, f"Tool 'Current Time' not found in {names}" - assert "Current" in names, ( - f"Tool 'Current Time' not found in {names}" - ) # pytest fails can also confirm on Github Actions + assert "Current Time" in names, f"Tool 'Current Time' not found in {names}" + # assert "Current" in names, ( + # f"Tool 'Current Time' not found in {names}" + # ) # pytest fails can also confirm on Github Actions def test_module_import_with_missing_llm(monkeypatch):