Get rid of the warning:
teuthology/util/test/test_scanner.py::TestValgrindScanner::test_scan_all_files
/Users/kyr/kshtsk/teuthology/teuthology/util/scanner.py:133: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
if not xml_tree:
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@clyso.com>
def _parse(self, file_content: str) -> Tuple[Optional[str], Optional[dict]]:
xml_tree = etree.fromstring(file_content)
- if not xml_tree:
+ if xml_tree is None:
return None, None
error_tree = xml_tree.find('error')