From 2bfc401fc6c85ed610e6d92d818a8a5ea15c851006d9e37d8669cde2531523ad Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 1 Jun 2021 16:42:05 +0000 Subject: [PATCH] Accepting request 896722 from home:pmonrealgonzalez:branches:devel:languages:python - Adapt test_etree.py to a behavioural change in libxml2 2.9.11+ * Add python-lxml-test_etree.patch OBS-URL: https://build.opensuse.org/request/show/896722 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lxml?expand=0&rev=147 --- python-lxml-test_etree.patch | 25 +++++++++++++++++++++++++ python-lxml.changes | 6 ++++++ python-lxml.spec | 3 +++ 3 files changed, 34 insertions(+) create mode 100644 python-lxml-test_etree.patch diff --git a/python-lxml-test_etree.patch b/python-lxml-test_etree.patch new file mode 100644 index 0000000..6428af6 --- /dev/null +++ b/python-lxml-test_etree.patch @@ -0,0 +1,25 @@ +From 852ed1092bd80b6b9a51db24371047ec88843031 Mon Sep 17 00:00:00 2001 +From: Stefan Behnel +Date: Tue, 18 May 2021 22:02:02 +0200 +Subject: [PATCH] Adapt a test to a behavioural change in libxml2 2.9.11+. + +--- + src/lxml/tests/test_etree.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/lxml/tests/test_etree.py b/src/lxml/tests/test_etree.py +index 9cf70604b..42613dcbe 100644 +--- 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('aa').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 diff --git a/python-lxml.changes b/python-lxml.changes index 3d6db5c..4f758ad 100644 --- a/python-lxml.changes +++ b/python-lxml.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jun 1 11:29:24 UTC 2021 - Pedro Monreal + +- Adapt test_etree.py to a behavioural change in libxml2 2.9.11+ + * Add python-lxml-test_etree.patch + ------------------------------------------------------------------- Tue Apr 6 01:51:29 UTC 2021 - Dirk Müller diff --git a/python-lxml.spec b/python-lxml.spec index e96a48f..61bc893 100644 --- a/python-lxml.spec +++ b/python-lxml.spec @@ -26,6 +26,8 @@ Group: Development/Languages/Python URL: https://lxml.de/ Source0: https://files.pythonhosted.org/packages/source/l/lxml/lxml-%{version}.tar.gz Source1: https://lxml.de/lxmldoc-4.5.2.pdf +# PATCH-FIX-UPSTREAM Adapt test_etree.py to a behavioural change in libxml2 2.9.11+ +Patch0: python-lxml-test_etree.patch BuildRequires: %{python_module Cython >= 0.29.7} BuildRequires: %{python_module cssselect >= 0.9.1} BuildRequires: %{python_module setuptools >= 18.0.1} @@ -70,6 +72,7 @@ This package contains header files needed to use lxml's C API. %prep %setup -q -n lxml-%{version} +%patch0 -p1 cp %{SOURCE1} . # remove generated files