Summary
Add integration tests that exercise the full data fetch and pipeline flow using pre-recorded API fixture responses, without making live network calls. This is the missing layer between unit tests (which already exist) and end-to-end pipeline runs.
Motivation
Unit tests for parsing and rendering exist, but there are no integration tests that verify the full data-fetch → parse → compute → render chain. Without integration tests, any API schema change silently breaks the pipeline. Mocked integration tests also allow CI to run without live API keys, which is critical for public contributors and a standard expectation for any production-grade Python project.
Implementation Approach
Use responses or pytest-recording (VCR cassettes) to record and replay HTTP interactions:
# tests/integration/test_pipeline_integration.py
import responses
@responses.activate
def test_full_pipeline_aapl(fixture_sec_response, fixture_yahoo_response):
responses.add(responses.GET, SEC_XBRL_URL, json=fixture_sec_response)
responses.add(responses.GET, YAHOO_URL, json=fixture_yahoo_response)
result = run_pipeline(ticker='AAPL', as_of='2026-03-31')
assert result['rating'] in ('Buy', 'Hold', 'Sell')
assert result['target_price'] > 0
assert 'html' in result['outputs']
Fixture Files to Create
tests/
├── fixtures/
│ ├── sec_xbrl_aapl.json # Sample EDGAR XBRL response
│ ├── yahoo_summary_aapl.json # Sample Yahoo Finance summary
│ ├── fred_cpi.json # Sample FRED CPI series
│ └── ecb_sdmx.xml # Sample ECB SDMX response
└── integration/
├── test_pipeline_integration.py
├── test_valuation_integration.py
└── test_reporting_integration.py
Acceptance Criteria
Summary
Add integration tests that exercise the full data fetch and pipeline flow using pre-recorded API fixture responses, without making live network calls. This is the missing layer between unit tests (which already exist) and end-to-end pipeline runs.
Motivation
Unit tests for parsing and rendering exist, but there are no integration tests that verify the full data-fetch → parse → compute → render chain. Without integration tests, any API schema change silently breaks the pipeline. Mocked integration tests also allow CI to run without live API keys, which is critical for public contributors and a standard expectation for any production-grade Python project.
Implementation Approach
Use
responsesorpytest-recording(VCR cassettes) to record and replay HTTP interactions:Fixture Files to Create
Acceptance Criteria
tests/integration/using fixture responses (no live API calls)@pytest.mark.integrationand included in CI by defaultpytest -m integrationcommand