From 975abfa25971b08d2296db65ddeeea87d566de53 Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari Date: Sun, 19 Oct 2025 16:21:59 +0200 Subject: python3-soupsieve: fix ptests Some ptests have started to fail, due to a change in libxml 2.9.12 (oe-core ships with 2.9.14 currently). See upstream issue: https://github.com/facelessuser/soupsieve/issues/220 This backported patch solves this issue. Signed-off-by: Gyorgy Sarvari --- .../update_tests_for_latest_libxml.patch | 162 +++++++++++++++++++++ .../python/python3-soupsieve_2.3.1.bb | 1 + 2 files changed, 163 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-soupsieve/update_tests_for_latest_libxml.patch (limited to 'meta-python') diff --git a/meta-python/recipes-devtools/python/python3-soupsieve/update_tests_for_latest_libxml.patch b/meta-python/recipes-devtools/python/python3-soupsieve/update_tests_for_latest_libxml.patch new file mode 100644 index 0000000000..3792565d1a --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-soupsieve/update_tests_for_latest_libxml.patch @@ -0,0 +1,162 @@ +From 64748a27d4cbd701c364bab1511c57c69b2b05a8 Mon Sep 17 00:00:00 2001 +From: facelessuser +Date: Thu, 16 Dec 2021 13:31:37 -0700 +Subject: [PATCH 1/2] Update tests to account for latest lxml and libxml2 + versions + +Fixes #220 + +Upstream-Status: Backport [https://github.com/facelessuser/soupsieve/commit/a8640aad6ae0476e6b62f4f15e12ad4efc7605c4] +Signed-off-by: Gyorgy Sarvari + +diff --git a/tests/test_extra/test_soup_contains.py b/tests/test_extra/test_soup_contains.py +index 1de8a04..af5fa3b 100644 +--- a/tests/test_extra/test_soup_contains.py ++++ b/tests/test_extra/test_soup_contains.py +@@ -144,7 +144,7 @@ def test_contains_escapes(self): + flags=util.HTML + ) + +- def test_contains_cdata_html(self): ++ def test_contains_cdata_html5(self): + """Test contains CDATA in HTML5.""" + + markup = """ +@@ -155,7 +155,40 @@ def test_contains_cdata_html(self): + markup, + 'body *:-soup-contains("that")', + ['1'], +- flags=util.HTML ++ flags=util.HTML5 ++ ) ++ ++ def test_contains_cdata_py_html(self): ++ """Test contains CDATA in Python HTML parser.""" ++ ++ markup = """ ++
Testing that contains works.
++ """ ++ ++ self.assert_selector( ++ markup, ++ 'body *:-soup-contains("that")', ++ ['1'], ++ flags=util.PYHTML ++ ) ++ ++ @util.skip_no_lxml ++ def test_contains_cdata_lxml_html(self): ++ """Test contains CDATA in `lxml` HTML parser.""" ++ ++ from lxml import etree ++ LIBXML_VER = etree.LIBXML_VERSION ++ ++ markup = """ ++
Testing that contains works.
++ """ ++ ++ results = ['1', '2'] if LIBXML_VER >= (2, 9, 11) else ['1'] ++ self.assert_selector( ++ markup, ++ 'body *:-soup-contains("that")', ++ results, ++ flags=util.LXML_HTML + ) + + def test_contains_cdata_xhtml(self): +diff --git a/tests/test_extra/test_soup_contains_own.py b/tests/test_extra/test_soup_contains_own.py +index 1a1be88..cb4118b 100644 +--- a/tests/test_extra/test_soup_contains_own.py ++++ b/tests/test_extra/test_soup_contains_own.py +@@ -35,7 +35,7 @@ def test_contains_own(self): + flags=util.HTML + ) + +- def test_contains_own_cdata_html(self): ++ def test_contains_own_cdata_html5(self): + """Test contains CDATA in HTML5.""" + + markup = """ +@@ -46,7 +46,40 @@ def test_contains_own_cdata_html(self): + markup, + 'body *:-soup-contains-own("that")', + ['1'], +- flags=util.HTML ++ flags=util.HTML5 ++ ) ++ ++ def test_contains_own_cdata_py_html(self): ++ """Test contains CDATA in Python HTML parser.""" ++ ++ markup = """ ++
Testing that contains works.
++ """ ++ ++ self.assert_selector( ++ markup, ++ 'body *:-soup-contains-own("that")', ++ ['1'], ++ flags=util.PYHTML ++ ) ++ ++ @util.skip_no_lxml ++ def test_contains_own_cdata_lxml_html(self): ++ """Test contains CDATA in `lxml` HTML.""" ++ ++ from lxml import etree ++ LIBXML_VER = etree.LIBXML_VERSION ++ ++ markup = """ ++
Testing that contains works.
++ """ ++ ++ results = ['1', '2'] if LIBXML_VER >= (2, 9, 11) else ['1'] ++ self.assert_selector( ++ markup, ++ 'body *:-soup-contains-own("that")', ++ results, ++ flags=util.LXML_HTML + ) + + def test_contains_own_cdata_xml(self): + +diff --git a/tests/test_extra/test_soup_contains.py b/tests/test_extra/test_soup_contains.py +index af5fa3b..66240db 100644 +--- a/tests/test_extra/test_soup_contains.py ++++ b/tests/test_extra/test_soup_contains.py +@@ -177,13 +177,13 @@ def test_contains_cdata_lxml_html(self): + """Test contains CDATA in `lxml` HTML parser.""" + + from lxml import etree +- LIBXML_VER = etree.LIBXML_VERSION ++ libxml_ver = etree.LIBXML_VERSION + + markup = """ +
Testing that contains works.
+ """ + +- results = ['1', '2'] if LIBXML_VER >= (2, 9, 11) else ['1'] ++ results = ['1', '2'] if libxml_ver >= (2, 9, 11) else ['1'] + self.assert_selector( + markup, + 'body *:-soup-contains("that")', +diff --git a/tests/test_extra/test_soup_contains_own.py b/tests/test_extra/test_soup_contains_own.py +index cb4118b..a4b33b4 100644 +--- a/tests/test_extra/test_soup_contains_own.py ++++ b/tests/test_extra/test_soup_contains_own.py +@@ -68,13 +68,13 @@ def test_contains_own_cdata_lxml_html(self): + """Test contains CDATA in `lxml` HTML.""" + + from lxml import etree +- LIBXML_VER = etree.LIBXML_VERSION ++ libxml_ver = etree.LIBXML_VERSION + + markup = """ +
Testing that contains works.
+ """ + +- results = ['1', '2'] if LIBXML_VER >= (2, 9, 11) else ['1'] ++ results = ['1', '2'] if libxml_ver >= (2, 9, 11) else ['1'] + self.assert_selector( + markup, + 'body *:-soup-contains-own("that")', diff --git a/meta-python/recipes-devtools/python/python3-soupsieve_2.3.1.bb b/meta-python/recipes-devtools/python/python3-soupsieve_2.3.1.bb index 631a45c99e..0ef0c7e791 100644 --- a/meta-python/recipes-devtools/python/python3-soupsieve_2.3.1.bb +++ b/meta-python/recipes-devtools/python/python3-soupsieve_2.3.1.bb @@ -10,6 +10,7 @@ inherit pypi python_setuptools_build_meta ptest SRC_URI += " \ file://run-ptest \ + file://update_tests_for_latest_libxml.patch \ " RDEPENDS:${PN}-ptest += " \ -- cgit v1.2.3-54-g00ecf