summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-10-29 16:11:59 +0100
committerSam James <sam@gentoo.org>2021-10-29 16:11:59 +0100
commita7c581c17cf5d123604e0eab833273b8792edc63 (patch)
tree797d7c45472d9d5e1535efe249acbc4ed7db4ab8 /dev-python/soupsieve
parentdev-python/lxml: fix tests with newer libxml2 (diff)
downloadgentoo-a7c581c17cf5d123604e0eab833273b8792edc63.tar.gz
gentoo-a7c581c17cf5d123604e0eab833273b8792edc63.tar.bz2
gentoo-a7c581c17cf5d123604e0eab833273b8792edc63.zip
dev-python/soupsieve: skip tests broken due to known lxml bug
Using Debian's patch. Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python/soupsieve')
-rw-r--r--dev-python/soupsieve/files/soupsieve-2.2.1-lxml-libxml2-tests.patch64
-rw-r--r--dev-python/soupsieve/soupsieve-2.2.1-r1.ebuild (renamed from dev-python/soupsieve/soupsieve-2.2.1.ebuild)9
2 files changed, 72 insertions, 1 deletions
diff --git a/dev-python/soupsieve/files/soupsieve-2.2.1-lxml-libxml2-tests.patch b/dev-python/soupsieve/files/soupsieve-2.2.1-lxml-libxml2-tests.patch
new file mode 100644
index 000000000000..a7075fa6fb6d
--- /dev/null
+++ b/dev-python/soupsieve/files/soupsieve-2.2.1-lxml-libxml2-tests.patch
@@ -0,0 +1,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."""
+
diff --git a/dev-python/soupsieve/soupsieve-2.2.1.ebuild b/dev-python/soupsieve/soupsieve-2.2.1-r1.ebuild
index c7f078edb7b3..02ac9fda95fc 100644
--- a/dev-python/soupsieve/soupsieve-2.2.1.ebuild
+++ b/dev-python/soupsieve/soupsieve-2.2.1-r1.ebuild
@@ -19,9 +19,16 @@ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 s
BDEPEND="
test? (
dev-python/beautifulsoup4[${PYTHON_USEDEP}]
- <dev-python/lxml-4.6.3-r1[${PYTHON_USEDEP}]
+ dev-python/lxml[${PYTHON_USEDEP}]
dev-python/html5lib[${PYTHON_USEDEP}]
)
"
+PATCHES=(
+ # Needed for now until something is figured out either at lxml
+ # upstream or libxml2?
+ # See https://github.com/facelessuser/soupsieve/issues/220
+ "${FILESDIR}"/${PN}-2.2.1-lxml-libxml2-tests.patch
+)
+
distutils_enable_tests pytest