Files
letta-server/tests/conftest.py
Shubham Naik 5a743d1dc4 Add 'apps/core/' from commit 'ea2a7395f4023f5b9fab03e6273db3b64a1181d5'
git-subtree-dir: apps/core
git-subtree-mainline: a8963e11e7a5a0059acbc849ce768e1eee80df61
git-subtree-split: ea2a7395f4023f5b9fab03e6273db3b64a1181d5
2024-12-22 20:31:22 -08:00

34 lines
743 B
Python

import logging
import pytest
def pytest_configure(config):
logging.basicConfig(level=logging.DEBUG)
@pytest.fixture
def mock_e2b_api_key_none():
from letta.settings import tool_settings
# Store the original value of e2b_api_key
original_api_key = tool_settings.e2b_api_key
# Set e2b_api_key to None
tool_settings.e2b_api_key = None
# Yield control to the test
yield
# Restore the original value of e2b_api_key
tool_settings.e2b_api_key = original_api_key
@pytest.fixture
def check_e2b_key_is_set():
from letta.settings import tool_settings
original_api_key = tool_settings.e2b_api_key
assert original_api_key is not None, "Missing e2b key! Cannot execute these tests."
yield