diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-18 18:36:34 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-18 18:36:34 +0800 |
| commit | ef81ecafcb5a07efd557e15fe686cb434cf45261 (patch) | |
| tree | 822913ec79953e18894c57c6e17e2613cc5ab6ff /tests | |
| parent | 4fc50787ca27af048eeec824c72934b96a72673c (diff) | |
| download | strategy-lab-ef81ecafcb5a07efd557e15fe686cb434cf45261.tar.gz | |
[变更性质] 执行假设移出用户面 warnings:result 独立 assumptions 字段承载,worker 侧守门测试断言 EXECUTION_ASSUMPTIONS 不再拼入 warnings
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/worker/test_backtest.py | 12 |
1 files changed, 12 insertions, 0 deletions
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) |
