diff options
| author | Gyorgy Sarvari <skandigraun@gmail.com> | 2025-10-19 16:21:59 +0200 |
|---|---|---|
| committer | Gyorgy Sarvari <skandigraun@gmail.com> | 2025-10-20 11:59:36 +0200 |
| commit | 975abfa25971b08d2296db65ddeeea87d566de53 (patch) | |
| tree | b2d990a529b34895635b4b7bc59d0910e92d4831 /meta-python | |
| parent | 9c72ce1d339c7ccb93429483cb56fe4d2f64638d (diff) | |
| download | meta-openembedded-975abfa25971b08d2296db65ddeeea87d566de53.tar.gz | |
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 <skandigraun@gmail.com>
Diffstat (limited to 'meta-python')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-soupsieve/update_tests_for_latest_libxml.patch | 162 | ||||
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-soupsieve_2.3.1.bb | 1 |
2 files changed, 163 insertions, 0 deletions
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 @@ | |||
| 1 | From 64748a27d4cbd701c364bab1511c57c69b2b05a8 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: facelessuser <faceless.shop@gmail.com> | ||
| 3 | Date: Thu, 16 Dec 2021 13:31:37 -0700 | ||
| 4 | Subject: [PATCH 1/2] Update tests to account for latest lxml and libxml2 | ||
| 5 | versions | ||
| 6 | |||
| 7 | Fixes #220 | ||
| 8 | |||
| 9 | Upstream-Status: Backport [https://github.com/facelessuser/soupsieve/commit/a8640aad6ae0476e6b62f4f15e12ad4efc7605c4] | ||
| 10 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 11 | |||
| 12 | diff --git a/tests/test_extra/test_soup_contains.py b/tests/test_extra/test_soup_contains.py | ||
| 13 | index 1de8a04..af5fa3b 100644 | ||
| 14 | --- a/tests/test_extra/test_soup_contains.py | ||
| 15 | +++ b/tests/test_extra/test_soup_contains.py | ||
| 16 | @@ -144,7 +144,7 @@ def test_contains_escapes(self): | ||
| 17 | flags=util.HTML | ||
| 18 | ) | ||
| 19 | |||
| 20 | - def test_contains_cdata_html(self): | ||
| 21 | + def test_contains_cdata_html5(self): | ||
| 22 | """Test contains CDATA in HTML5.""" | ||
| 23 | |||
| 24 | markup = """ | ||
| 25 | @@ -155,7 +155,40 @@ def test_contains_cdata_html(self): | ||
| 26 | markup, | ||
| 27 | 'body *:-soup-contains("that")', | ||
| 28 | ['1'], | ||
| 29 | - flags=util.HTML | ||
| 30 | + flags=util.HTML5 | ||
| 31 | + ) | ||
| 32 | + | ||
| 33 | + def test_contains_cdata_py_html(self): | ||
| 34 | + """Test contains CDATA in Python HTML parser.""" | ||
| 35 | + | ||
| 36 | + markup = """ | ||
| 37 | + <body><div id="1">Testing that <span id="2"><![CDATA[that]]></span>contains works.</div></body> | ||
| 38 | + """ | ||
| 39 | + | ||
| 40 | + self.assert_selector( | ||
| 41 | + markup, | ||
| 42 | + 'body *:-soup-contains("that")', | ||
| 43 | + ['1'], | ||
| 44 | + flags=util.PYHTML | ||
| 45 | + ) | ||
| 46 | + | ||
| 47 | + @util.skip_no_lxml | ||
| 48 | + def test_contains_cdata_lxml_html(self): | ||
| 49 | + """Test contains CDATA in `lxml` HTML parser.""" | ||
| 50 | + | ||
| 51 | + from lxml import etree | ||
| 52 | + LIBXML_VER = etree.LIBXML_VERSION | ||
| 53 | + | ||
| 54 | + markup = """ | ||
| 55 | + <body><div id="1">Testing that <span id="2"><![CDATA[that]]></span>contains works.</div></body> | ||
| 56 | + """ | ||
| 57 | + | ||
| 58 | + results = ['1', '2'] if LIBXML_VER >= (2, 9, 11) else ['1'] | ||
| 59 | + self.assert_selector( | ||
| 60 | + markup, | ||
| 61 | + 'body *:-soup-contains("that")', | ||
| 62 | + results, | ||
| 63 | + flags=util.LXML_HTML | ||
| 64 | ) | ||
| 65 | |||
| 66 | def test_contains_cdata_xhtml(self): | ||
| 67 | diff --git a/tests/test_extra/test_soup_contains_own.py b/tests/test_extra/test_soup_contains_own.py | ||
| 68 | index 1a1be88..cb4118b 100644 | ||
| 69 | --- a/tests/test_extra/test_soup_contains_own.py | ||
| 70 | +++ b/tests/test_extra/test_soup_contains_own.py | ||
| 71 | @@ -35,7 +35,7 @@ def test_contains_own(self): | ||
| 72 | flags=util.HTML | ||
| 73 | ) | ||
| 74 | |||
| 75 | - def test_contains_own_cdata_html(self): | ||
| 76 | + def test_contains_own_cdata_html5(self): | ||
| 77 | """Test contains CDATA in HTML5.""" | ||
| 78 | |||
| 79 | markup = """ | ||
| 80 | @@ -46,7 +46,40 @@ def test_contains_own_cdata_html(self): | ||
| 81 | markup, | ||
| 82 | 'body *:-soup-contains-own("that")', | ||
| 83 | ['1'], | ||
| 84 | - flags=util.HTML | ||
| 85 | + flags=util.HTML5 | ||
| 86 | + ) | ||
| 87 | + | ||
| 88 | + def test_contains_own_cdata_py_html(self): | ||
| 89 | + """Test contains CDATA in Python HTML parser.""" | ||
| 90 | + | ||
| 91 | + markup = """ | ||
| 92 | + <body><div id="1">Testing that <span id="2"><![CDATA[that]]></span>contains works.</div></body> | ||
| 93 | + """ | ||
| 94 | + | ||
| 95 | + self.assert_selector( | ||
| 96 | + markup, | ||
| 97 | + 'body *:-soup-contains-own("that")', | ||
| 98 | + ['1'], | ||
| 99 | + flags=util.PYHTML | ||
| 100 | + ) | ||
| 101 | + | ||
| 102 | + @util.skip_no_lxml | ||
| 103 | + def test_contains_own_cdata_lxml_html(self): | ||
| 104 | + """Test contains CDATA in `lxml` HTML.""" | ||
| 105 | + | ||
| 106 | + from lxml import etree | ||
| 107 | + LIBXML_VER = etree.LIBXML_VERSION | ||
| 108 | + | ||
| 109 | + markup = """ | ||
| 110 | + <body><div id="1">Testing that <span id="2"><![CDATA[that]]></span>contains works.</div></body> | ||
| 111 | + """ | ||
| 112 | + | ||
| 113 | + results = ['1', '2'] if LIBXML_VER >= (2, 9, 11) else ['1'] | ||
| 114 | + self.assert_selector( | ||
| 115 | + markup, | ||
| 116 | + 'body *:-soup-contains-own("that")', | ||
| 117 | + results, | ||
| 118 | + flags=util.LXML_HTML | ||
| 119 | ) | ||
| 120 | |||
| 121 | def test_contains_own_cdata_xml(self): | ||
| 122 | |||
| 123 | diff --git a/tests/test_extra/test_soup_contains.py b/tests/test_extra/test_soup_contains.py | ||
| 124 | index af5fa3b..66240db 100644 | ||
| 125 | --- a/tests/test_extra/test_soup_contains.py | ||
| 126 | +++ b/tests/test_extra/test_soup_contains.py | ||
| 127 | @@ -177,13 +177,13 @@ def test_contains_cdata_lxml_html(self): | ||
| 128 | """Test contains CDATA in `lxml` HTML parser.""" | ||
| 129 | |||
| 130 | from lxml import etree | ||
| 131 | - LIBXML_VER = etree.LIBXML_VERSION | ||
| 132 | + libxml_ver = etree.LIBXML_VERSION | ||
| 133 | |||
| 134 | markup = """ | ||
| 135 | <body><div id="1">Testing that <span id="2"><![CDATA[that]]></span>contains works.</div></body> | ||
| 136 | """ | ||
| 137 | |||
| 138 | - results = ['1', '2'] if LIBXML_VER >= (2, 9, 11) else ['1'] | ||
| 139 | + results = ['1', '2'] if libxml_ver >= (2, 9, 11) else ['1'] | ||
| 140 | self.assert_selector( | ||
| 141 | markup, | ||
| 142 | 'body *:-soup-contains("that")', | ||
| 143 | diff --git a/tests/test_extra/test_soup_contains_own.py b/tests/test_extra/test_soup_contains_own.py | ||
| 144 | index cb4118b..a4b33b4 100644 | ||
| 145 | --- a/tests/test_extra/test_soup_contains_own.py | ||
| 146 | +++ b/tests/test_extra/test_soup_contains_own.py | ||
| 147 | @@ -68,13 +68,13 @@ def test_contains_own_cdata_lxml_html(self): | ||
| 148 | """Test contains CDATA in `lxml` HTML.""" | ||
| 149 | |||
| 150 | from lxml import etree | ||
| 151 | - LIBXML_VER = etree.LIBXML_VERSION | ||
| 152 | + libxml_ver = etree.LIBXML_VERSION | ||
| 153 | |||
| 154 | markup = """ | ||
| 155 | <body><div id="1">Testing that <span id="2"><![CDATA[that]]></span>contains works.</div></body> | ||
| 156 | """ | ||
| 157 | |||
| 158 | - results = ['1', '2'] if LIBXML_VER >= (2, 9, 11) else ['1'] | ||
| 159 | + results = ['1', '2'] if libxml_ver >= (2, 9, 11) else ['1'] | ||
| 160 | self.assert_selector( | ||
| 161 | markup, | ||
| 162 | '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 | |||
| 10 | 10 | ||
| 11 | SRC_URI += " \ | 11 | SRC_URI += " \ |
| 12 | file://run-ptest \ | 12 | file://run-ptest \ |
| 13 | file://update_tests_for_latest_libxml.patch \ | ||
| 13 | " | 14 | " |
| 14 | 15 | ||
| 15 | RDEPENDS:${PN}-ptest += " \ | 16 | RDEPENDS:${PN}-ptest += " \ |
