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

Olivier Dion dion at linutronix.de
Thu Jul 23 04:51:16 CEST 2020


Testsuite.to_xml_string is deprecated. It will be removed in version
2.0.0.

Signed-off-by: Olivier Dion <dion 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)
-- 
2.27.0



More information about the elbe-devel mailing list