🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
Modify to make LLM a fixture in test cases
mannaandpoem0ed2c56035b4
diff --git a/tests/metagpt/actions/test_design_api_an.py b/tests/metagpt/actions/test_design_api_an.pyindex e50288640..32d6c11b0 100644--- a/tests/metagpt/actions/test_design_api_an.py+++ b/tests/metagpt/actions/test_design_api_an.py@@ -92,7 +92,9 @@ CONTEXT = """"""-llm = OpenAIGPTAPI()+def llm():+ return OpenAIGPTAPI()@pytest.mark.asynciodiff --git a/tests/metagpt/actions/test_project_management_an.py b/tests/metagpt/actions/test_project_management_an.pyindex 86c5e3685..116dffe83 100644--- a/tests/metagpt/actions/test_project_management_an.py+++ b/tests/metagpt/actions/test_project_management_an.py@@ -131,11 +131,14 @@ CONTEXT = """}"""-llm = OpenAIGPTAPI()++def llm():+ return OpenAIGPTAPI()@pytest.mark.asyncio-async def test_project_management_an():+async def test_project_management_an(llm):node = await REFINED_PM_NODES.fill(CONTEXT, llm)assert node.instruct_contentassert "Refined Logic Analysis" in node.instruct_content.json(ensure_ascii=False)diff --git a/tests/metagpt/actions/test_write_code_guideline_an.py b/tests/metagpt/actions/test_write_code_guideline_an.pyindex c9fb78e0e..602145ce8 100644--- a/tests/metagpt/actions/test_write_code_guideline_an.py+++ b/tests/metagpt/actions/test_write_code_guideline_an.py@@ -7,7 +7,7 @@"""import pytest-from metagpt.actions import WriteCode+from metagpt.actions.write_code import WriteCodefrom metagpt.actions.write_code_guideline_an import (CODE_GUIDELINE_CONTEXT,CODE_GUIDELINE_SCRIPT_EXAMPLE,@@ -15,7 +15,6 @@ from metagpt.actions.write_code_guideline_an import (REFINED_CODE_TEMPLATE,WriteCodeGuideline,)-from metagpt.provider import OpenAIGPTAPIREQUIREMENT_EXAMPLE = """Add subtraction, multiplication and division operations to the calculator.The current calculator can only perform basic addition operations, and it is necessary to introduce subtraction, multiplication, division operation into the calculator@@ -80,8 +79,6 @@ INCREMENTAL_CHANGE_EXAMPLE = """}"""-llm = OpenAIGPTAPI()-@pytest.mark.asyncioasync def test_write_code_guideline_an():diff --git a/tests/metagpt/actions/test_write_prd_an.py b/tests/metagpt/actions/test_write_prd_an.pyindex a7424bf49..ef0dd2eff 100644--- a/tests/metagpt/actions/test_write_prd_an.py+++ b/tests/metagpt/actions/test_write_prd_an.py@@ -75,11 +75,14 @@ Please change the game's score target from 2048 to 4096, and change the interfac-"""-llm = OpenAIGPTAPI()++def llm():+ return OpenAIGPTAPI()@pytest.mark.asyncio-async def test_write_prd_an():+async def test_write_prd_an(llm):node = await REFINE_PRD_NODE.fill(CONTEXT, llm)assert node.instruct_contentassert "Refined Requirement Pool" in node.instruct_content.json(ensure_ascii=False)