mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-11 10:14:32 +01:00
Fix logging setup for testing
This commit is contained in:
@@ -174,7 +174,7 @@ def retry_api(
|
||||
}
|
||||
api_key_error_msg = (
|
||||
f"Please double check that you have setup a "
|
||||
f"{Fore.CYAN + Style.BRIGHT}PAID{Style.RESET_ALL} OpenAI API Account. You can "
|
||||
f"{Style.BRIGHT}PAID{Style.NORMAL} OpenAI API Account. You can "
|
||||
f"read more here: {Fore.CYAN}https://docs.agpt.co/setup/#getting-an-api-key{Fore.RESET}"
|
||||
)
|
||||
backoff_msg = "Waiting {backoff} seconds..."
|
||||
|
||||
@@ -43,7 +43,7 @@ class AutoGptFormatter(logging.Formatter):
|
||||
|
||||
# Determine color for title
|
||||
title = getattr(record, "title", "")
|
||||
title_color = getattr(record, "title_color", level_color)
|
||||
title_color = getattr(record, "title_color", "") or level_color
|
||||
if title and title_color:
|
||||
title = f"{title_color + Style.BRIGHT}{title}{Style.RESET_ALL}"
|
||||
# Make sure record.title is set, and padded with a space if not empty
|
||||
|
||||
@@ -58,7 +58,6 @@ def config(
|
||||
config.plugins_config_file = temp_plugins_config_file
|
||||
|
||||
config.plain_output = True
|
||||
configure_logging(config, Path(__file__).parent / "logs")
|
||||
|
||||
# avoid circular dependency
|
||||
from autogpt.plugins.plugins_config import PluginsConfig
|
||||
@@ -78,6 +77,11 @@ def config(
|
||||
yield config
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_logger(config: Config):
|
||||
configure_logging(config, Path(__file__).parent / "logs")
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def api_manager() -> ApiManager:
|
||||
if ApiManager in ApiManager._instances:
|
||||
|
||||
Reference in New Issue
Block a user