@pytest.mark.unit def test_replay_cli_defaults_follow_live_settings(): """For each affected option, calling with the flag UNSET yields the live read — explicit values still WIN. Covers the 10 acceptance items on the bug spec.""" # ---- Stub feature_flags.hot_flag + settings (no live I/O) ----------------- # # Composition with FF.hot_flag stubbing: when no override is given, hot_flag returns the default it # was called with — which the resolver passes as getattr(settings, KEY, fallback). Setting those # fallback values IS what drives the assertion. overrides = { "MARKET_STATE_ETF_TRAIL_STOP_PCT": 1.7, "MARKET_STATE_ETF_TRAIL_STOP_PCT_SHORT": 0.9, "MARKET_STATE_ETF_CHOP_SKIP_EFF": 0.22, "MARKET_STATE_ETF_BREAKOUT_GATE": "volume", "MARKET_STATE_ETF_REGIME_SIZING_ENABLED": True, "MARKET_STATE_ETF_SHORT_SUPPORT_GATE_ENABLED": True, "MKTSTATE_EXIT_LLM_CONSULT_ENABLED": True, "MKTSTATE_FLIP_LLM_CONSULT_ENABLED": True, "MARKET_STATE_ETF_EQUITY_PCT_YUCHAO": 0.40, "MARKET_STATE_ETF_EQUITY_PCT_MIAOYONG": 0.50, "MARKET_STATE_ETF_EQUITY_PCT_CUIXIA": 0.30, } > with _patch_hot_flag(), _patch_settings(**overrides): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/services/test_backtest_live_parity.py:448: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../.pyenv/versions/3.12.12/lib/python3.12/contextlib.py:301: in helper return _GeneratorContextManager(func, args, kwds) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = func = , args = () kwds = {'MARKET_STATE_ETF_BREAKOUT_GATE': 'volume', 'MARKET_STATE_ETF_CHOP_SKIP_EFF': 0.22, 'MARKET_STATE_ETF_EQUITY_PCT_CUIXIA': 0.3, 'MARKET_STATE_ETF_EQUITY_PCT_MIAOYONG': 0.5, ...} def __init__(self, func, args, kwds): > self.gen = func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ E TypeError: _patch_settings() got an unexpected keyword argument 'MARKET_STATE_ETF_TRAIL_STOP_PCT' ../.pyenv/versions/3.12.12/lib/python3.12/contextlib.py:105: TypeError