New paste Repaste Download
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x12736e900>
    def test_time_review_fails_closed_to_hold_on_a_dead_consult(monkeypatch):
        """THE SAFETY ARGUMENT. There is no mechanical exit candidate on the table — nothing wanted this
        leg closed — so a hung or dead consult must leave the position untouched. At a 15-minute cadence
        the opposite posture would let a provider outage liquidate the book, which is this session's
        token-runaway wearing a costume that reaches money."""
        from rtrader.services import signal_sim_engine as se
    
        closed = []
    
        class _Decider:
            def decide_exit(self, *a, **k):
                raise RuntimeError("provider down")
    
        class _Leg:
            gen, direction, source, vehicle, entry_px = 1, "short", "rollover", "TZA", 40.0
    
        class _State:
            open_legs = [_Leg()]
            transitions = []
            direction = "short"
    
        class _Ctx:
            day = None
            def price_at(self, v, et): return 41.0
    
        class _Ev:
            et = "11:00:00"
            payload = {"gen": 1}
    
        monkeypatch.setattr(se, "_close_leg", lambda *a, **k: closed.append(1))
>       se._on_time_review(_State(), _Ev(), None, _Ctx(), object(), _Decider())
        ^^^^^^^^^^^^^^^^^^
E       AttributeError: module 'rtrader.services.signal_sim_engine' has no attribute '_on_time_review'
tests/services/test_decision_layers_and_house_rule.py:321: AttributeError
Filename: None. Size: 1kb. View raw, , hex, or download this file.

This paste expires on 2026-08-05 07:52:08.726971+00:00. Pasted through deprecated-web.