From 21b38109aaa41ccab2aa27192c69ff1422b43bf8 Mon Sep 17 00:00:00 2001 From: momentum dev Date: Wed, 22 Jul 2026 09:30:14 -0500 Subject: [PATCH] test: clamp test pins BACKTEST_MAX_SESSIONS env (default moved to 300) Co-Authored-By: Claude Fable 5 --- tests/unit/api/test_backtest_endpoint.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/api/test_backtest_endpoint.py b/tests/unit/api/test_backtest_endpoint.py index b6cd0ac..737f713 100644 --- a/tests/unit/api/test_backtest_endpoint.py +++ b/tests/unit/api/test_backtest_endpoint.py @@ -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