feat(cli): run an analysis without questions from flags (#1127, #1133)

- --ticker, --date and --analysts answer their steps, checked as the prompts check them; --save/--no-save and --show/--no-show answer the questions after the run
- with no terminal, the run stops before it starts and names every flag or TRADINGAGENTS_* variable still needed; a missing API key and an announcement no longer wait for input
- README shows an unattended run
This commit is contained in:
Yijia-Xiao
2026-09-24 20:42:51 +00:00
parent a1b3b5bab8
commit 0c602846ba
11 changed files with 347 additions and 59 deletions
+9
View File
@@ -45,6 +45,15 @@ def _no_network(request, monkeypatch):
monkeypatch.setattr(socket.socket, "connect_ex", refuse)
@pytest.fixture(autouse=True)
def _at_a_terminal(monkeypatch):
"""Tests of the interactive steps run as if at a terminal; pytest's stdin is
not one. A test of an unattended run sets isatty to False itself."""
import sys
monkeypatch.setattr(sys.stdin, "isatty", lambda: True)
@pytest.fixture(autouse=True)
def _own_cli_prefs(tmp_path, monkeypatch):
"""The CLI keeps the last run's selections in the user's home; tests keep theirs apart."""