Skip to content

Commit 65f2833

Browse files
committed
scripts: tests: twister_blackbox: drop lxml dependency
No need to rely on lxml for such a simple XML parsing task. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent db47c89 commit 65f2833

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scripts/tests/twister_blackbox/test_report.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
import shutil
1515
import sys
1616
import re
17-
18-
from lxml import etree
17+
import xml.etree.ElementTree as etree
1918

2019
# pylint: disable=no-name-in-module
2120
from conftest import TEST_DATA, ZEPHYR_BASE, testsuite_filename_mock, clear_log_in_test
@@ -162,7 +161,7 @@ def test_platform_reports(self, capfd, out_path, test_path, test_platforms, file
162161

163162
elif path.endswith(".xml"):
164163
tree = etree.parse(path)
165-
xml_text = etree.tostring(tree, encoding="utf-8").decode("utf-8")
164+
xml_text = etree.tostring(tree.getroot(), encoding="unicode")
166165
assert xml_text.strip(), f"XML file '{path}' is empty"
167166

168167
elif path.endswith(".log"):

0 commit comments

Comments
 (0)