From 8c7b8d0aedaf9448cd35d47d8ab83d975bb84790 Mon Sep 17 00:00:00 2001 From: mayor Date: Wed, 20 May 2026 15:24:34 +1000 Subject: [PATCH] fix(tests): remove duplicate test_python_function_adapter_non_dict_structured_raises The Tier 2 parallel example dispatch resulted in two PRs (structured_extraction and text_to_sql) each independently adding the same test function name to the shared test_python_function_adapter.py. The first PR (structured_extraction) added it at line 131 with a list-returning async agent; subsequent PRs added a second definition at line 200 with a string-returning sync agent. Both cover the same case (structured field is not a dict -> AdapterError); the first definition is canonical. Ruff F811 caught the redefinition on main, breaking CI for the second and third PRs that landed. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../test_adapters/test_python_function_adapter.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tests/unit/test_adapters/test_python_function_adapter.py b/tests/unit/test_adapters/test_python_function_adapter.py index 4123c30..151625b 100644 --- a/tests/unit/test_adapters/test_python_function_adapter.py +++ b/tests/unit/test_adapters/test_python_function_adapter.py @@ -197,17 +197,6 @@ async def my_agent(case: dict[str, Any], variant: dict[str, Any]) -> dict[str, A assert trace.output.final_answer == "extracted" -async def test_python_function_adapter_non_dict_structured_raises() -> None: - def bad(case: dict[str, Any], variant: dict[str, Any]) -> dict[str, Any]: - return {"final_answer": "x", "structured": "not-a-dict"} - - _install_module("fake_pf_mod_structured_bad", run=bad) - adapter = PythonFunctionAdapter(name="x", target="fake_pf_mod_structured_bad:run") - async with adapter: - with pytest.raises(AdapterError, match="structured"): - await adapter.run(_case(), _variant(), None) - - async def test_python_function_adapter_run_outside_context_raises() -> None: def my_agent(case: dict[str, Any], variant: dict[str, Any]) -> dict[str, Any]: return {"final_answer": "x"}