Skip to content

Commit

Permalink
dev-python/lxml: fix tests with newer libxml2
Browse files Browse the repository at this point in the history
Backport of upstream commit.

Closes: https://bugs.gentoo.org/791190
Signed-off-by: Sam James <[email protected]>
  • Loading branch information
thesamesam committed Oct 29, 2021
1 parent 4a92ce1 commit d13eae5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions dev-python/lxml/files/lxml-4.6.3-tests-libxml2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
https://github.com/lxml/lxml/commit/852ed1092bd80b6b9a51db24371047ec88843031
https://bugs.gentoo.org/791190

From: Stefan Behnel <[email protected]>
Date: Tue, 18 May 2021 22:02:02 +0200
Subject: [PATCH] Adapt a test to a behavioural change in libxml2 2.9.11+.

--- a/src/lxml/tests/test_etree.py
+++ b/src/lxml/tests/test_etree.py
@@ -3036,7 +3036,10 @@ def test_subelement_nsmap(self):
def test_html_prefix_nsmap(self):
etree = self.etree
el = etree.HTML('<hha:page-description>aa</hha:page-description>').find('.//page-description')
- self.assertEqual({'hha': None}, el.nsmap)
+ if etree.LIBXML_VERSION < (2, 9, 11):
+ self.assertEqual({'hha': None}, el.nsmap)
+ else:
+ self.assertEqual({}, el.nsmap)

def test_getchildren(self):
Element = self.etree.Element

1 change: 1 addition & 0 deletions dev-python/lxml/lxml-4.6.3-r1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ DISTUTILS_IN_SOURCE_BUILD=1

PATCHES=(
"${FILESDIR}"/${PN}-4.6.0-tests-pypy.patch
"${FILESDIR}"/${P}-tests-libxml2.patch
)

python_check_deps() {
Expand Down

0 comments on commit d13eae5

Please sign in to comment.