Description
The fundamental data provider modules have insufficient test coverage, particularly around error-handling paths. The following files have coverage below 80% with specific gaps identified:
| File |
Coverage |
Missing Tests |
bfs_cpi_source.py |
74% |
negative cache, retry path |
bls_cpi_source.py |
68% |
retry path, invalid JSON |
statcan_cpi_source.py |
68% |
409 handling, CSV fallback |
oecd_sdmx_source.py |
79% |
JSON parsing edge cases |
This is a test coverage gap that increases the risk of regressions in the data acquisition layer, which is critical for the accuracy of fundamental analysis results.
Current State
- All four CPI data source modules have coverage below the project's 80% threshold
- Error-handling paths (retry, fallback, invalid responses) are untested
- A failure in any of these modules could silently return stale or incorrect data to the analysis pipeline
- No tests verify behavior when external APIs return unexpected responses (409, malformed JSON, empty CSV)
Acceptance Criteria
References
- Test coverage gap in fundamental data providers (4 files below 80%)
Additional Context
These data providers feed into the fundamental analysis pipeline. Untested error paths could result in stale or incorrect CPI data being used for market analysis without any indication to the user. Consider using respx or httpx mocking for HTTP-level tests and pytest parametrize for edge case coverage.
Description
The fundamental data provider modules have insufficient test coverage, particularly around error-handling paths. The following files have coverage below 80% with specific gaps identified:
bfs_cpi_source.pybls_cpi_source.pystatcan_cpi_source.pyoecd_sdmx_source.pyThis is a test coverage gap that increases the risk of regressions in the data acquisition layer, which is critical for the accuracy of fundamental analysis results.
Current State
Acceptance Criteria
bfs_cpi_source.pycoverage >= 80% — add tests for negative cache hit and retry pathbls_cpi_source.pycoverage >= 80% — add tests for retry path and invalid JSON response handlingstatcan_cpi_source.pycoverage >= 80% — add tests for HTTP 409 response and CSV fallback parsingoecd_sdmx_source.pycoverage >= 80% — add tests for JSON parsing edge cases (malformed SDMX-JSON, empty datasets)References
Additional Context
These data providers feed into the fundamental analysis pipeline. Untested error paths could result in stale or incorrect CPI data being used for market analysis without any indication to the user. Consider using
respxorhttpxmocking for HTTP-level tests andpytestparametrize for edge case coverage.