From d5dbeb96af012995b2493a46d1a6b2ac7982f40e Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Fri, 22 May 2026 14:54:06 +0000 Subject: [PATCH] tests: type the FidelityHolding factory list to satisfy CI mypy CI runs mypy on both broker_sync/ and tests/, with stricter 'Missing type arguments for generic type' enforcement. Local mypy was only scoped to broker_sync/. Annotate the test helper with list[FidelityHolding]; lift the import to module-level. --- tests/providers/test_fidelity_planviewer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/providers/test_fidelity_planviewer.py b/tests/providers/test_fidelity_planviewer.py index acfccbc..19c389a 100644 --- a/tests/providers/test_fidelity_planviewer.py +++ b/tests/providers/test_fidelity_planviewer.py @@ -17,6 +17,7 @@ from broker_sync.providers.fidelity_planviewer import ( gains_offset_delta_activity, ) from broker_sync.providers.parsers.fidelity import ( + FidelityHolding, parse_transactions_html, parse_valuation_json, ) @@ -152,8 +153,7 @@ def test_provider_caches_holdings_for_cli_snapshot_push() -> None: # -- delta-shaped gains offset (the monthly accumulation mechanism) -- -def _holdings_summing_to(total: Decimal) -> list: - from broker_sync.providers.parsers.fidelity import FidelityHolding +def _holdings_summing_to(total: Decimal) -> list[FidelityHolding]: return [FidelityHolding( fund_code="KDOA", fund_name="Test", units=Decimal("100"), unit_price=total / Decimal("100"), currency="GBP", total_value=total,