fixbug: os.environ

This commit is contained in:
莘权 马 2023-08-30 14:52:00 +08:00
parent bc9eb5ea93
commit b07b9919a0
5 changed files with 37 additions and 15 deletions

View file

@ -9,7 +9,9 @@
from unittest.mock import Mock
import pytest
import pytest_asyncio
from metagpt.config import Config
from metagpt.logs import logger
from metagpt.provider.openai_api import OpenAIGPTAPI as GPTAPI
import asyncio
@ -68,3 +70,7 @@ def proxy():
server = asyncio.get_event_loop().run_until_complete(asyncio.start_server(handle_client, "127.0.0.1", 0))
return "http://{}:{}".format(*server.sockets[0].getsockname())
@pytest.fixture(scope="session", autouse=True)
def init_config():
Config()