Fix test failure with updated lxml

This commit is contained in:
Kovid Goyal 2024-08-17 09:18:11 +05:30
parent cfe9c58db8
commit 23cf355130
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -165,7 +165,11 @@ def find_tests():
('a <?xml asd> b\n\ncd', ('a <?xml asd> b\n\ncd',
'<p class="description">a b</p><p class="description">cd</p>'), '<p class="description">a b</p><p class="description">cd</p>'),
]: ]:
try:
cval = comments_to_html(pat) cval = comments_to_html(pat)
except DeprecationWarning:
pass # new lxml + old Beautiful soup == deprecation warning
else:
self.assertEqual(cval, val) self.assertEqual(cval, val)
return unittest.defaultTestLoader.loadTestsFromTestCase(Test) return unittest.defaultTestLoader.loadTestsFromTestCase(Test)