[elbe-devel] [PATCH v2 11/12] test: add stdout field to ElbeTestCase and evaluate it in addSkip()

Torben Hohn torben.hohn at linutronix.de
Thu Jul 22 17:10:11 CEST 2021


While the stdout is now passed along with an Exception the function calls
for the SkipTest Exception do not allow us to pass the stdout along.

Add a stdout field to ElbeTestCase and potentially set
the current_testcase.stdout in ElbeTestResult.addSkip()

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/commands/test.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/elbepack/commands/test.py b/elbepack/commands/test.py
index c01176537..ef6882b6e 100644
--- a/elbepack/commands/test.py
+++ b/elbepack/commands/test.py
@@ -47,6 +47,7 @@ class ElbeTestCase(unittest.TestCase):
     def __init__(self, methodName='runTest', param=None):
         self.methodName = methodName
         self.param = param
+        self.stdout = None
         super().__init__(methodName)
 
     def __str__(self):
@@ -189,6 +190,8 @@ class ElbeTestResult(unittest.TestResult):
     def addSkip(self, test, reason):
         """Called when a test is skipped."""
         self.current_case.add_skipped_info(message=reason)
+        if test.stdout is not None:
+            self.current_case.stdout = test.stdout
         super().addSkip(test, reason)
 
     def get_xml(self):
-- 
2.20.1



More information about the elbe-devel mailing list