Skip to content

Commit

Permalink
test: Print hugr-cli's errors on python tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Jul 16, 2024
1 parent cb84b84 commit 0d77777
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hugr-py/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ def validate(h: Hugr, mermaid: bool = False, roundtrip: bool = True):
if mermaid:
cmd.append("--mermaid")
serial = h.to_serial().to_json()
subprocess.run(cmd, check=True, input=serial.encode()) # noqa: S603
try:
subprocess.run(cmd, check=True, input=serial.encode(), capture_output=True) # noqa: S603
except subprocess.CalledProcessError as e:
error = e.stderr.decode()
raise RuntimeError(error) from e

if roundtrip:
h2 = Hugr.from_serial(SerialHugr.load_json(json.loads(serial)))
Expand Down

0 comments on commit 0d77777

Please sign in to comment.