From ef81ecafcb5a07efd557e15fe686cb434cf45261 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Fri, 18 Sep 2026 18:36:34 +0800 Subject: [变更性质] 执行假设移出用户面 warnings:result 独立 assumptions 字段承载,worker 侧守门测试断言 EXECUTION_ASSUMPTIONS 不再拼入 warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/worker/test_backtest.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/worker/test_backtest.py b/tests/worker/test_backtest.py index 30f8e46..cb248ec 100644 --- a/tests/worker/test_backtest.py +++ b/tests/worker/test_backtest.py @@ -103,6 +103,18 @@ def test_synthetic_labeled_runs_next_bar_fill(tmp_path): assert abs(t["commission"] - t["value"] * 0.0003) < 1e-6 +def test_assumptions_out_of_warnings(tmp_path): + """执行假设说明移出用户面 warnings,独立 assumptions 字段承载。""" + from worker.backtest import EXECUTION_ASSUMPTIONS + req, _ = make_request(tmp_path, STRAT) + res = run_backtest(req) + assert res["assumptions"] == EXECUTION_ASSUMPTIONS + for w in res["warnings"]: + assert "execution assumptions" not in w + for k in EXECUTION_ASSUMPTIONS: + assert str(k) not in w + + def test_equity_cash_accounting(tmp_path): req, _ = make_request(tmp_path, STRAT) res = run_backtest(req) -- cgit v1.2.3