def assert_source(
        self,
        xmldom: ElementTree.Element | ElementTree.ElementTree,
        src: str,
    ) -> None:
        """Assert that the XML has a <source> element with `src`."""
        src = abs_file(src)
        elts = xmldom.findall(".//sources/source")
        assert any(elt.text == src for elt in elts)
Assert that the XML has a <source> element with `src`.
tests/test_xml.py