fix: harden preprocessing state and child capabilities

This commit is contained in:
2026-08-11 14:30:16 +02:00
parent a5916f6177
commit ee5ac381b3
12 changed files with 323 additions and 104 deletions
+7 -1
View File
@@ -24,6 +24,12 @@ from tht.mschema.models import (
from tht.mschema.render import to_mschema_text, to_schema_dict
@pytest.fixture(autouse=True)
def _child_capability_for_schema_unit_tests(monkeypatch):
import tht.cli.schema_cmd as command
monkeypatch.setattr(command, "_require_writer_capability", lambda **kwargs: None)
def _physical():
return PhysicalSchema(
database="d", schema="s", introspected_at=datetime(2026, 1, 1),
@@ -605,7 +611,7 @@ def test_fresh_process_human_warning_cardinality_is_one_across_failure_and_write
[sys.executable, "-c", probe, "schema", "suggest-fks", "--write", "-c", str(cfg)],
check=True, capture_output=True, text=True,
)
assert json.loads(response.stdout) == {"warnings": 1, "exit": 0}
assert json.loads(response.stdout) == {"warnings": 1, "exit": 1}
physical.unlink()
for branch in branches: