[elbe-devel] [PATCH 2/5] commands: test: Catch warning of junit

Bastian Germann bage at linutronix.de
Wed Jul 29 15:07:52 CEST 2020


Am 23.07.20 um 04:51 schrieb Olivier Dion:
> Testsuite.to_xml_string is deprecated. It will be removed in version
> 2.0.0.
> 
> Signed-off-by: Olivier Dion <dion at linutronix.de>

Reviewed-by: Bastian Germann <bage at linutronix.de>

> ---
>  elbepack/commands/test.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/elbepack/commands/test.py b/elbepack/commands/test.py
> index e65b0739..be493a99 100644
> --- a/elbepack/commands/test.py
> +++ b/elbepack/commands/test.py
> @@ -10,6 +10,7 @@ import optparse
>  import os
>  import re
>  import unittest
> +import warnings
>  
>  import junit_xml as junit
>  
> @@ -191,7 +192,9 @@ def run_command(argv):
>  
>      ts = junit.TestSuite(name="test", test_cases=cases)
>  
> -    results = junit.TestSuite.to_xml_string([ts], encoding="utf-8")
> +    with warnings.catch_warnings():
> +        warnings.simplefilter("ignore")
> +        results = junit.TestSuite.to_xml_string([ts], encoding="utf-8")
>  
>      if opt.output is None:
>          print(results)
> 


More information about the elbe-devel mailing list