Fix imports, type hints and fixtures for goal oriented tests (#3415)

This commit is contained in:
Reinier van der Leer
2023-04-27 19:16:56 +02:00
committed by GitHub
parent adbb47fb65
commit 3d89ed1787
6 changed files with 54 additions and 48 deletions

View File

@@ -5,7 +5,8 @@ import pytest
from autogpt.api_manager import ApiManager
from autogpt.config import Config
from autogpt.workspace import Workspace
from tests.vcr.openai_filter import before_record_request
pytest_plugins = ["tests.integration.agent_factory"]
@pytest.fixture()
@@ -25,8 +26,13 @@ def config(workspace: Workspace) -> Config:
# Do a little setup and teardown since the config object is a singleton
old_ws_path = config.workspace_path
old_file_logger_path = config.file_logger_path
config.workspace_path = workspace.root
config.file_logger_path = workspace.get_path("file_logger.txt")
yield config
config.file_logger_path = old_file_logger_path
config.workspace_path = old_ws_path