test: clamp test pins BACKTEST_MAX_SESSIONS env (default moved to 300)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
momentum devandClaude Fable 5 committed 2026-07-22 09:30:14 -05:00
1 parent 9d0a9df60e
commit 21b38109aa
1 file changed
+2 -1
+2 -1
View File
@@ -166,7 +166,8 @@ def test_replay_window_regime_gate_drops_unfavorable_session():
# --------------------------------------------------------------------------
# Test plan case 4: /api/backtest?days=9999 -> clamped
# --------------------------------------------------------------------------
def test_api_backtest_clamped_for_huge_days():
def test_api_backtest_clamped_for_huge_days(monkeypatch):
monkeypatch.setenv("BACKTEST_MAX_SESSIONS", "45") # cap is env-tunable (default 300)
state = DashboardState("momentum")
kind, status, payload = _get(state, "/api/backtest?days=9999")
assert kind == "json" and status == 200