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

Bastian Germann bage at linutronix.de
Thu Jul 22 21:46:34 CEST 2021


Am 22.07.21 um 17:10 schrieb Torben Hohn:
> 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>

Reviewed-by: Bastian Germann <bage 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):
> 


More information about the elbe-devel mailing list