TradingAgents/tests/unit
ahmet guzererler 6fa4c2340a
Fix `ThirdPartyTimeoutError` swallowing in `yfinance` dataflows (#127)
In dataflow API wrappers, generic `except Exception` handlers were swallowing
timeout exceptions (like `requests.exceptions.Timeout` and `ThirdPartyTimeoutError`),
preventing upstream retry logic and proper error handling from functioning correctly.

This patch:
- Adds explicit catching of `requests.exceptions.Timeout` to raise as `ThirdPartyTimeoutError` in `yfinance` wrapper modules (`y_finance.py`, `yfinance_news.py`, `yfinance_scanner.py`).
- Adds explicit catching and re-raising of `ThirdPartyTimeoutError` before generic exception handlers across the dataflows.
- Retains existing exception inheritance logic to avoid backward compatibility breaks.
- Updates `TestEnsureIndexesInInit` to use the explicit `ensure_indexes()` call per lazy loading changes.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-27 00:20:10 +01:00
..
agents Parallel pre-fetch for analyst agents to reduce LLM round-trips 2026-03-23 21:08:15 +00:00
__init__.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
conftest.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_alpha_vantage_exceptions.py fix(tests): complete PR #26 — enforce socket isolation in unit tier and add test suite reference doc (#30) 2026-03-19 17:41:25 +01:00
test_alpha_vantage_integration.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_alpha_vantage_scanner.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_api_usage.py Add API consumption estimation module and CLI command 2026-03-21 17:25:26 +00:00
test_cli_main_tools.py 🧪 Implement robust tool call parsing and unit tests 2026-03-21 14:56:12 +00:00
test_config_wiring.py merge: sync with upstream TauricResearch/TradingAgents v0.2.2 2026-03-23 12:17:25 +00:00
test_debate_rounds.py merge: sync with upstream TauricResearch/TradingAgents v0.2.2 2026-03-23 12:17:25 +00:00
test_e2e_api_integration.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_empty_state.py feat: PM brain upgrade — macro/micro agents & memory split (#123) 2026-03-26 12:55:24 +01:00
test_env_override.py fix(tests): complete PR #26 — enforce socket isolation in unit tier and add test suite reference doc (#30) 2026-03-19 17:41:25 +01:00
test_fast_reject.py feat: Fast-Reject [CRITICAL ABORT] short-circuit mechanism (#128) 2026-03-27 00:19:43 +01:00
test_finnhub_integration.py Fix Finnhub API error handling and add coverage 2026-03-21 14:51:29 +00:00
test_finnhub_scanner_utils.py 🧪 Add unit tests for _safe_fmt in finnhub_scanner 2026-03-21 22:20:19 +00:00
test_incident_fixes.py fix: harden dataflows layer against silent failures and data corruption 2026-03-22 07:23:14 +01:00
test_industry_deep_dive.py test: add tests and parsing logic for text formats in _extract_top_sectors 2026-03-21 08:28:35 +00:00
test_json_utils.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_langgraph_engine_extraction.py Fix report saving, event storing, auto tickers, portfolio report loading, and state propagation 2026-03-23 18:33:11 +00:00
test_langgraph_engine_run_modes.py fix: address all PR#106 review findings (ADR 016) (#106) 2026-03-25 11:14:23 +01:00
test_macro_bridge.py feat: include portfolio holdings in auto mode pipeline analysis (#104) 2026-03-24 18:35:53 +01:00
test_macro_memory.py feat: PM brain upgrade — macro/micro agents & memory split (#123) 2026-03-26 12:55:24 +01:00
test_macro_regime.py Merge pull request #54 from aguzererler/test-macro-regime-fmt-pct-18208719821293052000 2026-03-21 17:36:20 +01:00
test_mongo_report_store.py fix: address all PR#106 review findings (ADR 016) (#106) 2026-03-25 11:14:23 +01:00
test_notebook_sync.py Fix security vulnerability in NotebookLM sync subprocess calls 2026-03-21 22:17:55 +00:00
test_observability_integration.py fix: address all PR#106 review findings (ADR 016) (#106) 2026-03-25 11:14:23 +01:00
test_peer_comparison.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_portfolio_tools.py feat: add portfolio risk metrics module and LangChain agent tools 2026-03-20 14:42:43 +00:00
test_pr106_review_fixes.py Fix `ThirdPartyTimeoutError` swallowing in `yfinance` dataflows (#127) 2026-03-27 00:20:10 +01:00
test_pydantic_schema.py feat: PM brain upgrade — macro/micro agents & memory split (#123) 2026-03-26 12:55:24 +01:00
test_reflexion_memory.py fix: address all PR#106 review findings (ADR 016) (#106) 2026-03-25 11:14:23 +01:00
test_report_paths_run_id.py feat: load flow_id in FE to resume runs and fix max_tickers cap (#113) 2026-03-26 07:10:42 +01:00
test_report_store_run_id.py feat: load flow_id in FE to resume runs and fix max_tickers cap (#113) 2026-03-26 07:10:42 +01:00
test_scanner_fallback.py refactor(tests): consolidate live-API tests into integration/, move mocked tests to unit/ 2026-03-19 14:24:52 +01:00
test_scanner_graph.py feat(scanner): Finviz smart money scanner + Golden Overlap strategy 2026-03-24 16:03:17 +01:00
test_scanner_mocked.py feat(scanner): Finviz smart money scanner + Golden Overlap strategy 2026-03-24 16:03:17 +01:00
test_security_notebook_sync.py Fix security vulnerability in NotebookLM sync subprocess calls 2026-03-21 22:17:55 +00:00
test_stockstats_utils.py 🧪 Resolve PRs #56, #58, and #60 2026-03-21 16:51:49 +00:00
test_store_factory.py feat: load flow_id in FE to resume runs and fix max_tickers cap (#113) 2026-03-26 07:10:42 +01:00
test_summary_agents.py feat: PM brain upgrade — macro/micro agents & memory split (#123) 2026-03-26 12:55:24 +01:00
test_ttm_analysis.py Merge pull request #69 from aguzererler/copilot/review-financial-tools-implementation 2026-03-21 22:41:55 +01:00
test_vendor_failfast.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_yfinance_integration.py 🧪 Add tests for _extract_article_data in yfinance_news.py 2026-03-21 08:23:12 +00:00