self = monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x125fe0b00> def test_full_and_half_fail_reverts_to_pending(self, monkeypatch): broker = InsufficientFundsBrokerStub(max_affordable_shares=0) # all buys fail capture = make_capture() _patch_common(monkeypatch, broker, capture) plan = make_plan(shares=10, valid_until="2026-03-18") executor.worker_single_plan(plan) # Broker should have been called twice: 10 shares, then 5 shares > assert len(broker.buy_calls) == 2 E assert 0 == 2 E + where 0 = len([]) E + where [] = .buy_calls tests/test_trading_plan_insufficient_funds_retry.py:165: AssertionError