test(abnormal): 盘中基准动量测试的「今天」改用 cn_today() — 实现按北京日切今日, 测试脏行用宿主 date.today() 在 UTC 16-24 点窗口错开一天不再被排除, CI(UTC runner) 每晚必红 (#446 合并触发的既有时间炸弹, 与其改动无关)

This commit is contained in:
shy3130
2026-10-04 00:29:59 +08:00
parent 4bbe571ec9
commit 88e4c19bc2
+6 -2
View File
@@ -11,6 +11,7 @@ from app.indicators.pipeline import (
benchmark_momentum_today,
load_benchmark_momentum,
)
from app.market_time import cn_today
from app.services.abnormal_moves import (
_bench_rt_pct,
_hist_cache,
@@ -119,8 +120,11 @@ def test_benchmark_momentum_today_percent_not_treated_as_decimal(tmp_path) -> No
def test_benchmark_momentum_today_excludes_today_rows(tmp_path) -> None:
# 指数监控盘写入的今日行不能当昨收 (否则实时涨跌被重复叠加)
today = date.today()
# 指数监控盘写入的今日行不能当昨收 (否则实时涨跌被重复叠加)。
# 脏行日期必须与实现同用 cn_today(): 实现按北京日切「今天」,
# 用宿主 date.today() 在 UTC 16-24 点窗口会与北京日错开一天,
# 脏行不再被排除 (CI runner 是 UTC, 每晚必红)。
today = cn_today()
rows = [("000001.SH", d, 10.0 + i) for i, d in enumerate(_BENCH_DAYS)]
rows.append(("000001.SH", today, 99.0)) # 今日脏行
_write_index_daily(tmp_path, rows)