From 29bbe5752d9e4de6c001bbd214bccf0005689289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Mon, 25 Dec 2023 13:18:45 +0800 Subject: [PATCH] fixbug: WriteTest failed --- metagpt/actions/write_test.py | 2 +- tests/metagpt/actions/test_write_test.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/metagpt/actions/write_test.py b/metagpt/actions/write_test.py index 9eb0bdbb6..850606ca8 100644 --- a/metagpt/actions/write_test.py +++ b/metagpt/actions/write_test.py @@ -44,7 +44,7 @@ you should correctly import the necessary classes based on these file locations! class WriteTest(Action): name: str = "WriteTest" - context: Optional[str] = None + context: Optional[TestingContext] = None llm: BaseGPTAPI = Field(default_factory=LLM) async def write_code(self, prompt): diff --git a/tests/metagpt/actions/test_write_test.py b/tests/metagpt/actions/test_write_test.py index a3190fb0e..9c6971ad3 100644 --- a/tests/metagpt/actions/test_write_test.py +++ b/tests/metagpt/actions/test_write_test.py @@ -51,3 +51,7 @@ async def test_write_code_invalid_code(mocker): # Assert that the returned code is the same as the invalid code string assert code == "Invalid Code String" + + +if __name__ == "__main__": + pytest.main([__file__, "-s"])