> assert channel
E DeprecationWarning: Testing an element's truth value will raise an exception in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
Caution: Elements with no subelements will test as False. Testing the truth value of an Element is deprecated and will raise an exception in Python 3.14. Use specific len(elem) or elem is None test instead.:
element = root.find('foo')
if not element: # careful!
print("element not found, or element has no subelements")
if element is None:
print("element not found")
Changed in version 3.12: Testing the truth value of an Element emits DeprecationWarning.
While testing Python 3.12 in CI
https://github.com/scikit-hep/pyhf/blob/adddb0797c564a0158a8e2e69a58ee1f98604bf7/tests/test_export.py#L438-L450
raised
This comes from https://github.com/python/cpython/issues/83122 which landed in Python 3.12. This should get fixed before Python 3.12 support is added.
From the Python 3.12 docs: https://docs.python.org/3.12/library/xml.etree.elementtree.html#element-objects