Skip to content

Commit 10577ea

Browse files
test(cli): stabilize mode handling and fix network checkpoint error output
1 parent 807f2a8 commit 10577ea

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

extropy/cli/commands/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def network_command(
297297
and checkpoint.expanduser().resolve() != study_db.expanduser().resolve()
298298
):
299299
out.error("--checkpoint must point to the same canonical file as study.db")
300-
raise typer.Exit(1)
300+
raise typer.Exit(out.finish())
301301
checkpoint_db = study_db if (resume_requested or checkpoint is not None) else None
302302

303303
# Load agents

tests/test_cli.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
import sqlite3
66
from pathlib import Path
77

8+
import pytest
89
from typer.testing import CliRunner
910

1011
from extropy.cli.app import app
12+
from extropy.config import ExtropyConfig, configure, reset_config
1113
from extropy.cli.commands.validate import (
1214
_canonical_yaml_path_for_invalid,
1315
_is_persona_file,
@@ -19,6 +21,17 @@
1921
runner = CliRunner()
2022

2123

24+
@pytest.fixture(autouse=True)
25+
def _force_human_cli_mode():
26+
"""Keep CLI tests deterministic regardless local ~/.config/extropy/config.json."""
27+
reset_config()
28+
cfg = ExtropyConfig()
29+
cfg.cli.mode = "human"
30+
configure(cfg)
31+
yield
32+
reset_config()
33+
34+
2235
class TestConfigCommand:
2336
"""Tests for the config command."""
2437

0 commit comments

Comments
 (0)