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.
This commit is contained in:
Viktor Barzin 2026-05-22 14:54:06 +00:00
parent d860aef927
commit d5dbeb96af

View file

@ -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,