Spaces:
Running
on
Zero
Running
on
Zero
| """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)) | |
| 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() | |
| 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} | |
| ] | |
| def sample_portfolio_text(): | |
| """Sample portfolio input text for testing.""" | |
| return "AAPL 50\nGOOGL 30 shares\nMSFT 40" | |