Skip to content

Commit

Permalink
Enhance failure messages
Browse files Browse the repository at this point in the history
This is specifically for the CLI runner pytest fixture: Explicitly print
out stdout and stderr.
  • Loading branch information
CasperWA committed Dec 1, 2021
1 parent 2b6210f commit 3e09cc7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/dic2owl/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,13 @@ def _clirunner(
pytest.fail(
"The CLI call failed as expected, but the expected "
"error sub-string could not be found in stdout or "
f"stderr. Sub-string: {expected_error}"
f"stderr. Sub-string: {expected_error}\nSTDOUT: "
f"{error.stdout}\nSTDERR: {error.stderr}"
)
else:
pytest.fail(
"The CLI call failed when it didn't expect to.\n"
f"Information: {error}"
f"STDOUT: {error.stdout}\nSTDERR: {error.stderr}"
)
else:
return output
Expand Down

0 comments on commit 3e09cc7

Please sign in to comment.