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"])