fix: resolve Pydantic v2 compatibility and conftest path issues

- Remove duplicate Config class from BaseAITBCConfig (Pydantic v2 compatibility)
- Update conftest.py to use DATA_DIR and LOG_DIR constants directly
- Fix TypeError: get_log_path() missing required argument
- Tests now run successfully with PYTHONPATH set
This commit is contained in:
aitbc
2026-04-24 21:56:07 +02:00
parent 0081b9ee4d
commit 154627cdfa
2 changed files with 3 additions and 9 deletions

View File

@@ -41,12 +41,6 @@ class BaseAITBCConfig(BaseSettings):
default="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
description="Log format string"
)
class Config:
"""Pydantic configuration"""
env_file = str(ENV_FILE)
env_file_encoding = "utf-8"
case_sensitive = False
class AITBCConfig(BaseAITBCConfig):

View File

@@ -16,7 +16,7 @@ sys.path.insert(0, str(project_root))
sys.path.insert(0, str(project_root / "aitbc"))
# Import aitbc utilities for conftest
from aitbc import get_data_path, get_log_path
from aitbc import DATA_DIR, LOG_DIR
# Add necessary source paths
sys.path.insert(0, str(project_root / "packages" / "py" / "aitbc-core" / "src"))
@@ -50,9 +50,9 @@ sys.path.insert(0, str(project_root / "apps" / "coordinator-api"))
# Set up test environment
os.environ["TEST_MODE"] = "true"
os.environ["AUDIT_LOG_DIR"] = str(get_log_path() / "audit")
os.environ["AUDIT_LOG_DIR"] = str(LOG_DIR / "audit")
os.environ["TEST_DATABASE_URL"] = "sqlite:///:memory:"
os.environ["DATA_DIR"] = str(get_data_path())
os.environ["DATA_DIR"] = str(DATA_DIR)
# Mock missing optional dependencies
sys.modules['slowapi'] = Mock()