BrianIsaac's picture
feat: complete MVP integration with Gradio UI, database schema, and tests
18b9531
"""Pytest configuration and fixtures."""
import pytest
import sys
from pathlib import Path
# Add parent directory to path for imports
sys.path.insert(0, str(Path(__file__).parent.parent))
@pytest.fixture(scope="session")
def event_loop():
"""Create an instance of the default event loop for the test session."""
import asyncio
loop = asyncio.get_event_loop_policy().new_event_loop()
yield loop
loop.close()
@pytest.fixture
def sample_portfolio_holdings():
"""Sample portfolio holdings for testing."""
return [
{'ticker': 'AAPL', 'quantity': 50, 'dollar_amount': 0, 'cost_basis': 150.0},
{'ticker': 'GOOGL', 'quantity': 30, 'dollar_amount': 0, 'cost_basis': 2800.0},
{'ticker': 'MSFT', 'quantity': 40, 'dollar_amount': 0, 'cost_basis': 350.0}
]
@pytest.fixture
def sample_portfolio_text():
"""Sample portfolio input text for testing."""
return "AAPL 50\nGOOGL 30 shares\nMSFT 40"