diff --git a/tests/metagpt/actions/test_debug_error.py b/tests/metagpt/actions/test_debug_error.py index 5aa842c91..6258aa6d4 100644 --- a/tests/metagpt/actions/test_debug_error.py +++ b/tests/metagpt/actions/test_debug_error.py @@ -117,7 +117,6 @@ if __name__ == '__main__': @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_debug_error(): CONFIG.src_workspace = CONFIG.git_repo.workdir / uuid.uuid4().hex ctx = RunCodeContext( diff --git a/tests/metagpt/actions/test_design_api.py b/tests/metagpt/actions/test_design_api.py index 3c95d6eca..8d4720570 100644 --- a/tests/metagpt/actions/test_design_api.py +++ b/tests/metagpt/actions/test_design_api.py @@ -17,7 +17,6 @@ from tests.metagpt.actions.mock_markdown import PRD_SAMPLE @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_design_api(): inputs = ["我们需要一个音乐播放器,它应该有播放、暂停、上一曲、下一曲等功能。", PRD_SAMPLE] for prd in inputs: diff --git a/tests/metagpt/actions/test_design_api_review.py b/tests/metagpt/actions/test_design_api_review.py index 3e8867d2b..cfc29056f 100644 --- a/tests/metagpt/actions/test_design_api_review.py +++ b/tests/metagpt/actions/test_design_api_review.py @@ -11,7 +11,6 @@ from metagpt.actions.design_api_review import DesignReview @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_design_api_review(): prd = "我们需要一个音乐播放器,它应该有播放、暂停、上一曲、下一曲等功能。" api_design = """ diff --git a/tests/metagpt/actions/test_generate_questions.py b/tests/metagpt/actions/test_generate_questions.py index 4b75e213c..b7c9d3984 100644 --- a/tests/metagpt/actions/test_generate_questions.py +++ b/tests/metagpt/actions/test_generate_questions.py @@ -20,7 +20,6 @@ context = """ @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_generate_questions(): action = GenerateQuestions() rsp = await action.run(context) diff --git a/tests/metagpt/actions/test_invoice_ocr.py b/tests/metagpt/actions/test_invoice_ocr.py index 1408967f3..b4560f61b 100644 --- a/tests/metagpt/actions/test_invoice_ocr.py +++ b/tests/metagpt/actions/test_invoice_ocr.py @@ -54,7 +54,6 @@ async def test_generate_table(invoice_path: Path, expected_result: dict): ("invoice_path", "query", "expected_result"), [(Path("invoices/invoice-1.pdf"), "Invoicing date", "2023年02月03日")], ) -@pytest.mark.usefixtures("llm_mock") async def test_reply_question(invoice_path: Path, query: dict, expected_result: str): invoice_path = TEST_DATA_PATH / invoice_path ocr_result = await InvoiceOCR().run(file_path=Path(invoice_path)) diff --git a/tests/metagpt/actions/test_prepare_interview.py b/tests/metagpt/actions/test_prepare_interview.py index cb1257718..cd0c850ed 100644 --- a/tests/metagpt/actions/test_prepare_interview.py +++ b/tests/metagpt/actions/test_prepare_interview.py @@ -12,7 +12,6 @@ from metagpt.logs import logger @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_prepare_interview(): action = PrepareInterview() rsp = await action.run("I just graduated and hope to find a job as a Python engineer") diff --git a/tests/metagpt/actions/test_project_management.py b/tests/metagpt/actions/test_project_management.py index 97e98b57e..88263ff29 100644 --- a/tests/metagpt/actions/test_project_management.py +++ b/tests/metagpt/actions/test_project_management.py @@ -18,7 +18,6 @@ from tests.metagpt.actions.mock_json import DESIGN, PRD @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_design_api(): await FileRepository.save_file("1.txt", content=str(PRD), relative_path=PRDS_FILE_REPO) await FileRepository.save_file("1.txt", content=str(DESIGN), relative_path=SYSTEM_DESIGN_FILE_REPO) diff --git a/tests/metagpt/actions/test_summarize_code.py b/tests/metagpt/actions/test_summarize_code.py index 3ad450aa2..7ecb67afd 100644 --- a/tests/metagpt/actions/test_summarize_code.py +++ b/tests/metagpt/actions/test_summarize_code.py @@ -177,7 +177,6 @@ class Snake: @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_summarize_code(): CONFIG.src_workspace = CONFIG.git_repo.workdir / "src" await FileRepository.save_file(filename="1.json", relative_path=SYSTEM_DESIGN_FILE_REPO, content=DESIGN_CONTENT) diff --git a/tests/metagpt/actions/test_talk_action.py b/tests/metagpt/actions/test_talk_action.py index 0a1e240b0..953fdf44a 100644 --- a/tests/metagpt/actions/test_talk_action.py +++ b/tests/metagpt/actions/test_talk_action.py @@ -33,7 +33,6 @@ from metagpt.schema import Message ), ], ) -@pytest.mark.usefixtures("llm_mock") async def test_prompt(agent_description, language, context, knowledge, history_summary): # Prerequisites CONFIG.agent_description = agent_description diff --git a/tests/metagpt/actions/test_write_code.py b/tests/metagpt/actions/test_write_code.py index 109ba4208..249145c92 100644 --- a/tests/metagpt/actions/test_write_code.py +++ b/tests/metagpt/actions/test_write_code.py @@ -28,7 +28,6 @@ from tests.metagpt.actions.mock_markdown import TASKS_2, WRITE_CODE_PROMPT_SAMPL @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_write_code(): context = CodingContext( filename="task_filename.py", design_doc=Document(content="设计一个名为'add'的函数,该函数接受两个整数作为输入,并返回它们的和。") @@ -45,7 +44,6 @@ async def test_write_code(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_write_code_directly(): prompt = WRITE_CODE_PROMPT_SAMPLE + "\n" + TASKS_2[0] llm = LLM() @@ -54,7 +52,6 @@ async def test_write_code_directly(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_write_code_deps(): # Prerequisites CONFIG.src_workspace = CONFIG.git_repo.workdir / "snake1/snake1" diff --git a/tests/metagpt/actions/test_write_code_review.py b/tests/metagpt/actions/test_write_code_review.py index c5ac02bf6..3343b42b4 100644 --- a/tests/metagpt/actions/test_write_code_review.py +++ b/tests/metagpt/actions/test_write_code_review.py @@ -12,7 +12,6 @@ from metagpt.schema import CodingContext, Document @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_write_code_review(capfd): code = """ def add(a, b): diff --git a/tests/metagpt/actions/test_write_docstring.py b/tests/metagpt/actions/test_write_docstring.py index a27395668..a0fc46ebd 100644 --- a/tests/metagpt/actions/test_write_docstring.py +++ b/tests/metagpt/actions/test_write_docstring.py @@ -27,14 +27,12 @@ class Person: ], ids=["google", "numpy", "sphinx"], ) -@pytest.mark.usefixtures("llm_mock") async def test_write_docstring(style: str, part: str): ret = await WriteDocstring().run(code, style=style) assert part in ret @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_write(): code = await WriteDocstring.write_docstring(__file__) assert code diff --git a/tests/metagpt/actions/test_write_prd.py b/tests/metagpt/actions/test_write_prd.py index 89b432fe2..08be3cf75 100644 --- a/tests/metagpt/actions/test_write_prd.py +++ b/tests/metagpt/actions/test_write_prd.py @@ -18,7 +18,6 @@ from metagpt.utils.file_repository import FileRepository @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_write_prd(): product_manager = ProductManager() requirements = "开发一个基于大语言模型与私有知识库的搜索引擎,希望可以基于大语言模型进行搜索总结" diff --git a/tests/metagpt/actions/test_write_prd_review.py b/tests/metagpt/actions/test_write_prd_review.py index 5dd94dd77..9b3f0a285 100644 --- a/tests/metagpt/actions/test_write_prd_review.py +++ b/tests/metagpt/actions/test_write_prd_review.py @@ -11,7 +11,6 @@ from metagpt.actions.write_prd_review import WritePRDReview @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_write_prd_review(): prd = """ Introduction: This is a new feature for our product. diff --git a/tests/metagpt/actions/test_write_review.py b/tests/metagpt/actions/test_write_review.py index a73785397..2d188b720 100644 --- a/tests/metagpt/actions/test_write_review.py +++ b/tests/metagpt/actions/test_write_review.py @@ -46,7 +46,6 @@ CONTEXT = """ @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_write_review(): write_review = WriteReview() review = await write_review.run(CONTEXT) diff --git a/tests/metagpt/actions/test_write_teaching_plan.py b/tests/metagpt/actions/test_write_teaching_plan.py index d192be544..57a4f5eb0 100644 --- a/tests/metagpt/actions/test_write_teaching_plan.py +++ b/tests/metagpt/actions/test_write_teaching_plan.py @@ -16,7 +16,6 @@ from metagpt.actions.write_teaching_plan import WriteTeachingPlanPart ("topic", "context"), [("Title", "Lesson 1: Learn to draw an apple."), ("Teaching Content", "Lesson 1: Learn to draw an apple.")], ) -@pytest.mark.usefixtures("llm_mock") async def test_write_teaching_plan_part(topic, context): action = WriteTeachingPlanPart(topic=topic, context=context) rsp = await action.run() diff --git a/tests/metagpt/actions/test_write_test.py b/tests/metagpt/actions/test_write_test.py index ecf9dc8b3..9649b9abb 100644 --- a/tests/metagpt/actions/test_write_test.py +++ b/tests/metagpt/actions/test_write_test.py @@ -13,7 +13,6 @@ from metagpt.schema import Document, TestingContext @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_write_test(): code = """ import random @@ -40,7 +39,6 @@ async def test_write_test(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_write_code_invalid_code(mocker): # Mock the _aask method to return an invalid code string mocker.patch.object(WriteTest, "_aask", return_value="Invalid Code String") diff --git a/tests/metagpt/actions/test_write_tutorial.py b/tests/metagpt/actions/test_write_tutorial.py index ff7a5075c..27a323b44 100644 --- a/tests/metagpt/actions/test_write_tutorial.py +++ b/tests/metagpt/actions/test_write_tutorial.py @@ -14,7 +14,6 @@ from metagpt.actions.write_tutorial import WriteContent, WriteDirectory @pytest.mark.asyncio @pytest.mark.parametrize(("language", "topic"), [("English", "Write a tutorial about Python")]) -@pytest.mark.usefixtures("llm_mock") async def test_write_directory(language: str, topic: str): ret = await WriteDirectory(language=language).run(topic=topic) assert isinstance(ret, dict) @@ -30,7 +29,6 @@ async def test_write_directory(language: str, topic: str): ("language", "topic", "directory"), [("English", "Write a tutorial about Python", {"Introduction": ["What is Python?", "Why learn Python?"]})], ) -@pytest.mark.usefixtures("llm_mock") async def test_write_content(language: str, topic: str, directory: Dict): ret = await WriteContent(language=language, directory=directory).run(topic=topic) assert isinstance(ret, str) diff --git a/tests/metagpt/roles/test_architect.py b/tests/metagpt/roles/test_architect.py index 2f45fef84..06e4b2d11 100644 --- a/tests/metagpt/roles/test_architect.py +++ b/tests/metagpt/roles/test_architect.py @@ -22,7 +22,6 @@ from tests.metagpt.roles.mock import MockMessages @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_architect(): # Prerequisites filename = uuid.uuid4().hex + ".json" diff --git a/tests/metagpt/roles/test_assistant.py b/tests/metagpt/roles/test_assistant.py index 9f63da64d..24096b357 100644 --- a/tests/metagpt/roles/test_assistant.py +++ b/tests/metagpt/roles/test_assistant.py @@ -13,7 +13,6 @@ from pydantic import BaseModel from metagpt.actions.skill_action import SkillAction from metagpt.actions.talk_action import TalkAction from metagpt.config import CONFIG -from metagpt.logs import logger from metagpt.memory.brain_memory import BrainMemory from metagpt.roles.assistant import Assistant from metagpt.schema import Message @@ -21,7 +20,6 @@ from metagpt.utils.common import any_to_str @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_run(): CONFIG.language = "Chinese" @@ -88,7 +86,7 @@ async def test_run(): if not has_action: break msg: Message = await role.act() - logger.info(msg) + # logger.info(msg) assert msg assert msg.cause_by == seed.cause_by assert msg.content diff --git a/tests/metagpt/roles/test_engineer.py b/tests/metagpt/roles/test_engineer.py index 4a76bd96e..d03aea0a6 100644 --- a/tests/metagpt/roles/test_engineer.py +++ b/tests/metagpt/roles/test_engineer.py @@ -30,7 +30,6 @@ from tests.metagpt.roles.mock import STRS_FOR_PARSING, TASKS, MockMessages @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_engineer(): # Prerequisites rqno = "20231221155954.json" @@ -114,7 +113,6 @@ def test_todo(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_new_coding_context(): # Prerequisites demo_path = Path(__file__).parent / "../../data/demo_project" diff --git a/tests/metagpt/roles/test_invoice_ocr_assistant.py b/tests/metagpt/roles/test_invoice_ocr_assistant.py index 9c397146d..e3a9259da 100644 --- a/tests/metagpt/roles/test_invoice_ocr_assistant.py +++ b/tests/metagpt/roles/test_invoice_ocr_assistant.py @@ -41,7 +41,6 @@ from metagpt.schema import Message ), ], ) -@pytest.mark.usefixtures("llm_mock") async def test_invoice_ocr_assistant(query: str, invoice_path: Path, invoice_table_path: Path, expected_result: dict): invoice_path = TEST_DATA_PATH / invoice_path role = InvoiceOCRAssistant() diff --git a/tests/metagpt/roles/test_product_manager.py b/tests/metagpt/roles/test_product_manager.py index 0538cbe6d..2d36923e9 100644 --- a/tests/metagpt/roles/test_product_manager.py +++ b/tests/metagpt/roles/test_product_manager.py @@ -13,7 +13,6 @@ from tests.metagpt.roles.mock import MockMessages @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_product_manager(): product_manager = ProductManager() rsp = await product_manager.run(MockMessages.req) diff --git a/tests/metagpt/roles/test_project_manager.py b/tests/metagpt/roles/test_project_manager.py index fe2cd8ddb..9207623bc 100644 --- a/tests/metagpt/roles/test_project_manager.py +++ b/tests/metagpt/roles/test_project_manager.py @@ -13,7 +13,6 @@ from tests.metagpt.roles.mock import MockMessages @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_project_manager(): project_manager = ProjectManager() rsp = await project_manager.run(MockMessages.system_design) diff --git a/tests/metagpt/roles/test_teacher.py b/tests/metagpt/roles/test_teacher.py index 4da860b51..521e59c96 100644 --- a/tests/metagpt/roles/test_teacher.py +++ b/tests/metagpt/roles/test_teacher.py @@ -103,7 +103,6 @@ async def test_new_file_name(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_run(): CONFIG.set_context({"language": "Chinese", "teaching_language": "English"}) lesson = """ diff --git a/tests/metagpt/roles/test_tutorial_assistant.py b/tests/metagpt/roles/test_tutorial_assistant.py index 4653bc18b..0e6c1efb9 100644 --- a/tests/metagpt/roles/test_tutorial_assistant.py +++ b/tests/metagpt/roles/test_tutorial_assistant.py @@ -15,7 +15,6 @@ from metagpt.roles.tutorial_assistant import TutorialAssistant @pytest.mark.asyncio @pytest.mark.parametrize(("language", "topic"), [("Chinese", "Write a tutorial about pip")]) -@pytest.mark.usefixtures("llm_mock") async def test_tutorial_assistant(language: str, topic: str): role = TutorialAssistant(language=language) msg = await role.run(topic) diff --git a/tests/metagpt/serialize_deserialize/test_action.py b/tests/metagpt/serialize_deserialize/test_action.py index 571fd52ac..81879e34e 100644 --- a/tests/metagpt/serialize_deserialize/test_action.py +++ b/tests/metagpt/serialize_deserialize/test_action.py @@ -21,7 +21,6 @@ def test_action_serialize(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_action_deserialize(): action = Action() serialized_data = action.model_dump() diff --git a/tests/metagpt/serialize_deserialize/test_architect_deserialize.py b/tests/metagpt/serialize_deserialize/test_architect_deserialize.py index 81eec0c9d..b113912a7 100644 --- a/tests/metagpt/serialize_deserialize/test_architect_deserialize.py +++ b/tests/metagpt/serialize_deserialize/test_architect_deserialize.py @@ -17,7 +17,6 @@ def test_architect_serialize(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_architect_deserialize(): role = Architect() ser_role_dict = role.model_dump(by_alias=True) diff --git a/tests/metagpt/serialize_deserialize/test_prepare_interview.py b/tests/metagpt/serialize_deserialize/test_prepare_interview.py index a47b89bc7..cd9912103 100644 --- a/tests/metagpt/serialize_deserialize/test_prepare_interview.py +++ b/tests/metagpt/serialize_deserialize/test_prepare_interview.py @@ -8,7 +8,6 @@ from metagpt.actions.prepare_interview import PrepareInterview @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_action_deserialize(): action = PrepareInterview() serialized_data = action.model_dump() diff --git a/tests/metagpt/serialize_deserialize/test_product_manager.py b/tests/metagpt/serialize_deserialize/test_product_manager.py index f8a22471b..5e1624503 100644 --- a/tests/metagpt/serialize_deserialize/test_product_manager.py +++ b/tests/metagpt/serialize_deserialize/test_product_manager.py @@ -10,7 +10,6 @@ from metagpt.schema import Message @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_product_manager_deserialize(): role = ProductManager() ser_role_dict = role.model_dump(by_alias=True) diff --git a/tests/metagpt/serialize_deserialize/test_project_manager.py b/tests/metagpt/serialize_deserialize/test_project_manager.py index 2cff7a35c..1088a4461 100644 --- a/tests/metagpt/serialize_deserialize/test_project_manager.py +++ b/tests/metagpt/serialize_deserialize/test_project_manager.py @@ -18,7 +18,6 @@ def test_project_manager_serialize(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_project_manager_deserialize(): role = ProjectManager() ser_role_dict = role.model_dump(by_alias=True) diff --git a/tests/metagpt/serialize_deserialize/test_role.py b/tests/metagpt/serialize_deserialize/test_role.py index d34259351..d38797baf 100644 --- a/tests/metagpt/serialize_deserialize/test_role.py +++ b/tests/metagpt/serialize_deserialize/test_role.py @@ -69,7 +69,6 @@ def test_engineer_serialize(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_engineer_deserialize(): role = Engineer(use_code_review=True) ser_role_dict = role.model_dump() @@ -97,7 +96,6 @@ def test_role_serdeser_save(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_role_serdeser_interrupt(): role_c = RoleC() shutil.rmtree(SERDESER_PATH.joinpath("team"), ignore_errors=True) diff --git a/tests/metagpt/serialize_deserialize/test_team.py b/tests/metagpt/serialize_deserialize/test_team.py index 808f5089b..566f63c3d 100644 --- a/tests/metagpt/serialize_deserialize/test_team.py +++ b/tests/metagpt/serialize_deserialize/test_team.py @@ -109,7 +109,6 @@ async def test_team_recover_save(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_team_recover_multi_roles_save(): idea = "write a snake game" stg_path = SERDESER_PATH.joinpath("team") diff --git a/tests/metagpt/serialize_deserialize/test_write_code.py b/tests/metagpt/serialize_deserialize/test_write_code.py index 809d44a91..cb262bb45 100644 --- a/tests/metagpt/serialize_deserialize/test_write_code.py +++ b/tests/metagpt/serialize_deserialize/test_write_code.py @@ -17,7 +17,6 @@ def test_write_design_serialize(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_write_code_deserialize(): context = CodingContext( filename="test_code.py", design_doc=Document(content="write add function to calculate two numbers") diff --git a/tests/metagpt/serialize_deserialize/test_write_code_review.py b/tests/metagpt/serialize_deserialize/test_write_code_review.py index 95df7f7c3..991b3c13b 100644 --- a/tests/metagpt/serialize_deserialize/test_write_code_review.py +++ b/tests/metagpt/serialize_deserialize/test_write_code_review.py @@ -9,7 +9,6 @@ from metagpt.schema import CodingContext, Document @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_write_code_review_deserialize(): code_content = """ def div(a: int, b: int = 0): diff --git a/tests/metagpt/serialize_deserialize/test_write_design.py b/tests/metagpt/serialize_deserialize/test_write_design.py index 72cbdc8a8..7bcba3fc8 100644 --- a/tests/metagpt/serialize_deserialize/test_write_design.py +++ b/tests/metagpt/serialize_deserialize/test_write_design.py @@ -22,7 +22,6 @@ def test_write_task_serialize(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_write_design_deserialize(): action = WriteDesign() serialized_data = action.model_dump() @@ -32,7 +31,6 @@ async def test_write_design_deserialize(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_write_task_deserialize(): action = WriteTasks() serialized_data = action.model_dump() diff --git a/tests/metagpt/serialize_deserialize/test_write_docstring.py b/tests/metagpt/serialize_deserialize/test_write_docstring.py index 76b602d42..e4116ab30 100644 --- a/tests/metagpt/serialize_deserialize/test_write_docstring.py +++ b/tests/metagpt/serialize_deserialize/test_write_docstring.py @@ -29,7 +29,6 @@ class Person: ], ids=["google", "numpy", "sphinx"], ) -@pytest.mark.usefixtures("llm_mock") async def test_action_deserialize(style: str, part: str): action = WriteDocstring() serialized_data = action.model_dump() diff --git a/tests/metagpt/serialize_deserialize/test_write_prd.py b/tests/metagpt/serialize_deserialize/test_write_prd.py index 8f58f1f02..890e2438b 100644 --- a/tests/metagpt/serialize_deserialize/test_write_prd.py +++ b/tests/metagpt/serialize_deserialize/test_write_prd.py @@ -17,7 +17,6 @@ def test_action_serialize(): @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_action_deserialize(): action = WritePRD() serialized_data = action.model_dump() diff --git a/tests/metagpt/serialize_deserialize/test_write_review.py b/tests/metagpt/serialize_deserialize/test_write_review.py index ccd645db0..f02a01910 100644 --- a/tests/metagpt/serialize_deserialize/test_write_review.py +++ b/tests/metagpt/serialize_deserialize/test_write_review.py @@ -42,7 +42,6 @@ CONTEXT = """ @pytest.mark.asyncio -@pytest.mark.usefixtures("llm_mock") async def test_action_deserialize(): action = WriteReview() serialized_data = action.model_dump() diff --git a/tests/metagpt/serialize_deserialize/test_write_tutorial.py b/tests/metagpt/serialize_deserialize/test_write_tutorial.py index 40c1d3619..606a90f8c 100644 --- a/tests/metagpt/serialize_deserialize/test_write_tutorial.py +++ b/tests/metagpt/serialize_deserialize/test_write_tutorial.py @@ -9,7 +9,6 @@ from metagpt.actions.write_tutorial import WriteContent, WriteDirectory @pytest.mark.asyncio @pytest.mark.parametrize(("language", "topic"), [("English", "Write a tutorial about Python")]) -@pytest.mark.usefixtures("llm_mock") async def test_write_directory_deserialize(language: str, topic: str): action = WriteDirectory() serialized_data = action.model_dump() @@ -31,7 +30,6 @@ async def test_write_directory_deserialize(language: str, topic: str): ("language", "topic", "directory"), [("English", "Write a tutorial about Python", {"Introduction": ["What is Python?", "Why learn Python?"]})], ) -@pytest.mark.usefixtures("llm_mock") async def test_write_content_deserialize(language: str, topic: str, directory: Dict): action = WriteContent(language=language, directory=directory) serialized_data = action.model_dump() diff --git a/tests/metagpt/tools/test_translate.py b/tests/metagpt/tools/test_translate.py index 22ba4bfbc..53f00a88a 100644 --- a/tests/metagpt/tools/test_translate.py +++ b/tests/metagpt/tools/test_translate.py @@ -14,7 +14,6 @@ from metagpt.tools.translator import Translator @pytest.mark.asyncio @pytest.mark.usefixtures("llm_api") -@pytest.mark.usefixtures("llm_mock") async def test_translate(llm_api): poetries = [ ("Let life be beautiful like summer flowers", "花"),