fix(cli): say whether a checkpointed run resumed or started fresh

- the announcement existed but the run path never called it
- tested through run_analysis rather than by calling the helper directly
This commit is contained in:
Yijia-Xiao
2026-09-24 00:41:56 +00:00
parent 1e439352c0
commit 4a71dc708d
3 changed files with 33 additions and 24 deletions
-17
View File
@@ -95,23 +95,6 @@ def test_every_command_is_registered_when_run_as_a_module():
assert "--start" in plain
@pytest.mark.unit
def test_the_cli_says_whether_a_run_resumed(monkeypatch):
"""The README promises the user can tell a resumed run from a fresh one.
The graph logs it, but nothing configures logging, so it was never shown."""
import cli.main as m
messages = []
monkeypatch.setattr(m.message_buffer, "add_message",
lambda kind, text: messages.append(text), raising=False)
m._announce_checkpoint_state(type("G", (), {"_resuming": True})(), "NVDA", "2026-01-10")
m._announce_checkpoint_state(type("G", (), {"_resuming": False})(), "NVDA", "2026-01-10")
assert any("resum" in text.lower() for text in messages)
assert any("fresh" in text.lower() for text in messages)
@pytest.mark.unit
def test_backtest_can_continue_an_interrupted_sweep(runner, monkeypatch, tmp_path):
"""Resuming is what makes a long sweep practical, and the Python API has it."""