TradingAgents/tests/unit
copilot-swe-agent[bot] a77e3f1264 fix: make _map_langgraph_event crash-proof with try/except and _safe_dict
- Wrap each event-type branch (LLM start/end, tool start/end) in try/except
  to prevent a single unexpected object shape from crashing the streaming loop
- Add _safe_dict() helper to guard response_metadata and usage_metadata
  access — some providers return non-dict types (bound methods, etc.)
- Fix potential_text extraction: check for None AND callable before using
- Ensure all event IDs use .get() with fallback to prevent KeyError
- Fix test file: remove hardcoded /Users/Ahmet/ path, add edge-case tests
  for non-dict metadata, tool events, and unknown event types
- All 725 unit tests pass, TypeScript compiles clean

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/aguzererler/TradingAgents/sessions/fe6575b5-c03b-4037-bd98-a94303ae8313
2026-03-23 09:17:19 +00:00
..
agents/utils test: add unit tests for _tokenize in FinancialSituationMemory 2026-03-21 01:54:23 +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 🧹 fix: remove unused imports from agent_utils.py 2026-03-21 08:30:43 +00:00
test_debate_rounds.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_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_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_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: make _map_langgraph_event crash-proof with try/except and _safe_dict 2026-03-23 09:17:19 +00:00
test_macro_bridge.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_macro_regime.py Merge pull request #54 from aguzererler/test-macro-regime-fmt-pct-18208719821293052000 2026-03-21 17:36:20 +01:00
test_notebook_sync.py Fix security vulnerability in NotebookLM sync subprocess calls 2026-03-21 22:17:55 +00: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_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 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_scanner_mocked.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_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_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