From 7d0d77eadeaad769f7cd58468b9ffd46a31cd995 Mon Sep 17 00:00:00 2001 From: Casper Welzel Andersen Date: Mon, 30 Aug 2021 18:35:23 +0200 Subject: [PATCH] Enhance failure messages This is specifically for the CLI runner pytest fixture: Explicitly print out stdout and stderr. --- tests/dic2owl/conftest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/dic2owl/conftest.py b/tests/dic2owl/conftest.py index e924bcc..f4c06d6 100644 --- a/tests/dic2owl/conftest.py +++ b/tests/dic2owl/conftest.py @@ -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