summaryrefslogtreecommitdiff
path: root/dev-python/soupsieve/files/soupsieve-2.2.1-lxml-libxml2-tests.patch
blob: a7075fa6fb6d34c9fdca587e26ceea29b4c8b179 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
https://sources.debian.org/data/main/s/soupsieve/2.2.1-2/debian/patches/libxml2-2.9.11
https://github.com/facelessuser/soupsieve/issues/220

Apply Debian patch to skip tests which expose a lxml bug that's
already being handled elsewhere.

From: Stefano Rivera <stefanor@debian.org>
Date: Sat, 2 Oct 2021 12:05:17 -0700
Subject: Mark test_contains_cdata_html tests XFAIL for libxml2 >= 2.9.11

libxml2 changed CDATA handling in 2.9.11.
Beautifulsoup supports this change, but lxml upstream has pinned on an
older version so the behaviour change isn't standardised upstream, yet.

Bug-upstream: https://github.com/facelessuser/soupsieve/issues/220
Bug-lxml: https://bugs.launchpad.net/lxml/+bug/1928795
Bug-beautifulsoup: https://bugs.launchpad.net/beautifulsoup/+bug/1930164
Bug-Debian: https://bugs.debian.org/995459

Forwarded: no
--- a/tests/test_extra/test_soup_contains.py
+++ b/tests/test_extra/test_soup_contains.py
@@ -3,6 +3,9 @@ from .. import util
 import warnings
 import soupsieve as sv
 
+import pytest
+from lxml.etree import LIBXML_VERSION
+
 
 class TestSoupContains(util.TestCase):
     """Test soup-contains selectors."""
@@ -144,6 +147,9 @@ class TestSoupContains(util.TestCase):
             flags=util.HTML
         )
 
+    @pytest.mark.xfail(LIBXML_VERSION >= (2, 9, 11),
+        reason='lxml parser changed CDATA handling, see '
+               'https://github.com/facelessuser/soupsieve/issues/220')
     def test_contains_cdata_html(self):
         """Test contains CDATA in HTML5."""
 
--- a/tests/test_extra/test_soup_contains_own.py
+++ b/tests/test_extra/test_soup_contains_own.py
@@ -1,6 +1,9 @@
 """Test contains selectors."""
 from .. import util
 
+import pytest
+from lxml.etree import LIBXML_VERSION
+
 
 class TestSoupContainsOwn(util.TestCase):
     """Test soup-contains-own selectors."""
@@ -35,6 +38,9 @@ class TestSoupContainsOwn(util.TestCase):
             flags=util.HTML
         )
 
+    @pytest.mark.xfail(LIBXML_VERSION >= (2, 9, 11),
+        reason='lxml parser changed CDATA handling, see '
+               'https://github.com/facelessuser/soupsieve/issues/220')
     def test_contains_own_cdata_html(self):
         """Test contains CDATA in HTML5."""