test(dmsk): 季末日历炸弹拆除——canary/notice 两测锚日 FakeDate 固定, 治 09-30 当天 CI 必红 [nas] [no-doc]
canary=periods[1] 随墙钟翻页(Q3 末 09-30 入期集合, 次新变 06-30, 空 03-31 不再触发 rc=1); notice_filter 的 today not in pdirs 在季末当天必炸(dt=2026-09-30 是合法 REPORT_DATE 落点). 锚日=2026-09-08 非季末, 文件内 test_daily_marker_date_scoped 同款 FakeDate 工法. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -241,6 +241,18 @@ def test_in_batch_dedup_same_key_twice_in_response(root, monkeypatch):
|
||||
|
||||
def test_backfill_canary_empty_fails_and_never_marks(root, monkeypatch):
|
||||
# 次新期空=契约漂移疑云: failed+1, 不标 done 不落空库
|
||||
# 季末位面坑(09-30 CI 实案): canary=periods[1] 随墙钟翻页——Q3 末当天
|
||||
# 09-30 入期集合, 次新变 06-30, 空 03-31 不再触发 rc=1. 锚日=非季末
|
||||
# (文件先例 test_daily_marker_date_scoped 同款 FakeDate).
|
||||
real_date = dt.date
|
||||
|
||||
class FakeDate(real_date):
|
||||
@classmethod
|
||||
def today(cls):
|
||||
return real_date(2026, 9, 8)
|
||||
|
||||
monkeypatch.setattr(fdd.dt, "date", FakeDate)
|
||||
|
||||
def responder(d, p):
|
||||
return [] if p == "2026-03-31" else [_raw(period=p + " 00:00:00")]
|
||||
_patch_fetch(monkeypatch, responder)
|
||||
@@ -280,7 +292,18 @@ def test_limit_never_marks(root, monkeypatch):
|
||||
# ---------- daily lane ----------
|
||||
|
||||
def test_daily_notice_filter_and_period_dir(root, monkeypatch):
|
||||
today = dt.date.today()
|
||||
# 季末位面坑(09-30 CI 实案): 相对墙钟 today 会在 Q3 末当天撞进期集合
|
||||
# (dt=2026-09-30 是合法 REPORT_DATE 落点, "today not in pdirs" 必炸).
|
||||
# 锚日=非季末, 期集合与 notice 窗全相对锚日构造.
|
||||
real_date = dt.date
|
||||
|
||||
class FakeDate(real_date):
|
||||
@classmethod
|
||||
def today(cls):
|
||||
return real_date(2026, 9, 8)
|
||||
|
||||
monkeypatch.setattr(fdd.dt, "date", FakeDate)
|
||||
today = FakeDate.today()
|
||||
fresh = (today - dt.timedelta(days=1)).isoformat()
|
||||
stale = (today - dt.timedelta(days=30)).isoformat()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user