fix(harness): preserve session migration JSON errors
This commit is contained in:
@@ -26,3 +26,22 @@ def test_session_migrate_status_is_pristine_and_idempotent():
|
||||
assert second.exit_code == 0, second.output
|
||||
assert json.loads(first.stdout) == expected
|
||||
assert json.loads(second.stdout) == expected
|
||||
|
||||
|
||||
def test_session_migrate_status_database_failure_is_pristine_json():
|
||||
result = CliRunner().invoke(
|
||||
app,
|
||||
[
|
||||
"session",
|
||||
"migrate",
|
||||
"--database-url",
|
||||
"postgresql+psycopg2://test:test@127.0.0.1:1/test",
|
||||
"--status",
|
||||
"--json",
|
||||
],
|
||||
)
|
||||
|
||||
assert result.exit_code == 1
|
||||
assert result.stderr == ""
|
||||
assert "Traceback" not in result.stdout
|
||||
assert json.loads(result.stdout)["error"]
|
||||
|
||||
Reference in New Issue
Block a user