Testing Guidelines & Execution
Fonrex relies on pytest for unit, integration, and architectural verification.
Running Tests
Execute the complete test suite:
pytest
Run Specific Test Modules
# Test technical indicators engine
pytest tests/test_technical_indicators.py
# Test DCF valuation calculations
pytest tests/test_dcf_service.py
# Test News Aggregator & scrapers
pytest tests/test_news_service.py
# Test Provider Monitoring & Validation Layer
pytest tests/test_monitoring.py
Run Tests with Coverage Report
pytest --cov=. --cov-report=term-missing
Writing Tests
- Place unit tests inside
tests/. Name test filestest_*.py. - Use
pytest-mockto mock external scraping network requests (httpx,requests,yfinance). - Ensure no external web requests are made during unit test execution.