1 |
commit: d13eae5e5e10ef534833303d8a84cda4b2d81340 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 29 15:06:31 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 29 15:06:31 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d13eae5e |
7 |
|
8 |
dev-python/lxml: fix tests with newer libxml2 |
9 |
|
10 |
Backport of upstream commit. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/791190 |
13 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
14 |
|
15 |
.../lxml/files/lxml-4.6.3-tests-libxml2.patch | 22 ++++++++++++++++++++++ |
16 |
dev-python/lxml/lxml-4.6.3-r1.ebuild | 1 + |
17 |
2 files changed, 23 insertions(+) |
18 |
|
19 |
diff --git a/dev-python/lxml/files/lxml-4.6.3-tests-libxml2.patch b/dev-python/lxml/files/lxml-4.6.3-tests-libxml2.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..4c682add3a2 |
22 |
--- /dev/null |
23 |
+++ b/dev-python/lxml/files/lxml-4.6.3-tests-libxml2.patch |
24 |
@@ -0,0 +1,22 @@ |
25 |
+https://github.com/lxml/lxml/commit/852ed1092bd80b6b9a51db24371047ec88843031 |
26 |
+https://bugs.gentoo.org/791190 |
27 |
+ |
28 |
+From: Stefan Behnel <stefan_ml@××××××.de> |
29 |
+Date: Tue, 18 May 2021 22:02:02 +0200 |
30 |
+Subject: [PATCH] Adapt a test to a behavioural change in libxml2 2.9.11+. |
31 |
+ |
32 |
+--- a/src/lxml/tests/test_etree.py |
33 |
++++ b/src/lxml/tests/test_etree.py |
34 |
+@@ -3036,7 +3036,10 @@ def test_subelement_nsmap(self): |
35 |
+ def test_html_prefix_nsmap(self): |
36 |
+ etree = self.etree |
37 |
+ el = etree.HTML('<hha:page-description>aa</hha:page-description>').find('.//page-description') |
38 |
+- self.assertEqual({'hha': None}, el.nsmap) |
39 |
++ if etree.LIBXML_VERSION < (2, 9, 11): |
40 |
++ self.assertEqual({'hha': None}, el.nsmap) |
41 |
++ else: |
42 |
++ self.assertEqual({}, el.nsmap) |
43 |
+ |
44 |
+ def test_getchildren(self): |
45 |
+ Element = self.etree.Element |
46 |
+ |
47 |
|
48 |
diff --git a/dev-python/lxml/lxml-4.6.3-r1.ebuild b/dev-python/lxml/lxml-4.6.3-r1.ebuild |
49 |
index e0ce5bad3a3..cf132e42747 100644 |
50 |
--- a/dev-python/lxml/lxml-4.6.3-r1.ebuild |
51 |
+++ b/dev-python/lxml/lxml-4.6.3-r1.ebuild |
52 |
@@ -41,6 +41,7 @@ DISTUTILS_IN_SOURCE_BUILD=1 |
53 |
|
54 |
PATCHES=( |
55 |
"${FILESDIR}"/${PN}-4.6.0-tests-pypy.patch |
56 |
+ "${FILESDIR}"/${P}-tests-libxml2.patch |
57 |
) |
58 |
|
59 |
python_check_deps() { |