Skip to content

Commit

Permalink
Replace xml.etree.ElementTree.parse with its defusedxml
Browse files Browse the repository at this point in the history
Signed-off-by: Chaurasiya, Payal <[email protected]>
  • Loading branch information
payalcha committed Dec 26, 2024
1 parent c280f10 commit cf37385
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ paramiko
pytest==8.3.4
pytest-asyncio==0.25.0
pytest-mock==3.14.0
defusedxml==0.7.1
4 changes: 2 additions & 2 deletions tests/end_to_end/utils/summary_helper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2020-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

import xml.etree.ElementTree as ET
from defusedxml.ElementTree import parse as defused_parse
from lxml import etree
import os
from pathlib import Path
Expand All @@ -17,7 +17,7 @@
print(f"Results XML file not found at {result_xml}. Exiting...")
exit(1)

tree = ET.parse(result_xml, parser=parser)
tree = defused_parse(result_xml, parser=parser)

# Get the root element
testsuites = tree.getroot()
Expand Down

0 comments on commit cf37385

Please sign in to comment.