# -*- coding: utf-8 -*- from vdirsyncer.storage.dav import _parse_xml def test_broken_xml(capsys): rv = _parse_xml(b'

\x10haha

') assert rv.text == 'haha' warnings = capsys.readouterr()[1] assert 'partially invalid xml' in warnings.lower()