From 11e59c0c3286f83cdc4b452acf155ffddb43a98b Mon Sep 17 00:00:00 2001
From: Guillaume Chanel <Guillaume.Chanel@unige.ch>
Date: Fri, 21 Oct 2022 13:34:22 +0200
Subject: [PATCH] Show stderr if shell exits with error

---
 test/test.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/test.py b/test/test.py
index 154fda7..523bc6c 100644
--- a/test/test.py
+++ b/test/test.py
@@ -170,7 +170,7 @@ class Shell:
         #TODO: should I check if process is still running at that point (stream closed but process alive ?)
 
         if self.shell_process.returncode != 0:
-            raise AssertionError('Shell process exited with an error code ({})'.format(self.shell_process.returncode))
+            raise AssertionError('Shell process exited with an error code ({}). Standard error contains: "{}"'.format(self.shell_process.returncode, self.read_stderr()))
 
 
     def read_stdout(self):
-- 
GitLab