diff options
author | Khem Raj <raj.khem@gmail.com> | 2024-02-07 14:19:38 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-08 23:14:51 +0000 |
commit | 277e65c3c8431acff7a9de38cc1af97507c0ca16 (patch) | |
tree | e2c7976990f47cac01685821244786a92b9ffc2a /meta/recipes-devtools | |
parent | 06aab81591bcf0dda8a34c38dc87a722532bdc86 (diff) | |
download | poky-277e65c3c8431acff7a9de38cc1af97507c0ca16.tar.gz |
python3: Fix ptests with expat 2.6+
(From OE-Core rev: a19af24fc910bbfc39c863e3252770aa9975de5b)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/python/python3/0001-test_xml_etree.py-Fix-for-Expat-2.6.0-with-reparse-d.patch | 57 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3_3.12.1.bb | 1 |
2 files changed, 58 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/0001-test_xml_etree.py-Fix-for-Expat-2.6.0-with-reparse-d.patch b/meta/recipes-devtools/python/python3/0001-test_xml_etree.py-Fix-for-Expat-2.6.0-with-reparse-d.patch new file mode 100644 index 0000000000..415db4bc5b --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-test_xml_etree.py-Fix-for-Expat-2.6.0-with-reparse-d.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From 51a048251c552d9ead29a2a3e4884c138fcf9c1c Mon Sep 17 00:00:00 2001 | ||
2 | From: Sebastian Pipping <sebastian@pipping.org> | ||
3 | Date: Wed, 7 Feb 2024 15:32:45 +0100 | ||
4 | Subject: [PATCH] test_xml_etree.py: Fix for Expat >=2.6.0 with reparse deferral | ||
5 | |||
6 | Upstream-Status: Submitted [https://github.com/python/cpython/pull/115138] | ||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | --- | ||
9 | Lib/test/test_xml_etree.py | 10 ++++++---- | ||
10 | .../2024-02-07-15-49-37.gh-issue-115133.WBajNr.rst | 1 + | ||
11 | 2 files changed, 7 insertions(+), 4 deletions(-) | ||
12 | create mode 100644 Misc/NEWS.d/next/Tests/2024-02-07-15-49-37.gh-issue-115133.WBajNr.rst | ||
13 | |||
14 | diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py | ||
15 | index 53a4e9f..9a0119c 100644 | ||
16 | --- a/Lib/test/test_xml_etree.py | ||
17 | +++ b/Lib/test/test_xml_etree.py | ||
18 | @@ -1401,6 +1401,7 @@ class XMLPullParserTest(unittest.TestCase): | ||
19 | def test_simple_xml(self): | ||
20 | for chunk_size in (None, 1, 5): | ||
21 | with self.subTest(chunk_size=chunk_size): | ||
22 | + expected_events = [] | ||
23 | parser = ET.XMLPullParser() | ||
24 | self.assert_event_tags(parser, []) | ||
25 | self._feed(parser, "<!-- comment -->\n", chunk_size) | ||
26 | @@ -1410,16 +1411,17 @@ class XMLPullParserTest(unittest.TestCase): | ||
27 | chunk_size) | ||
28 | self.assert_event_tags(parser, []) | ||
29 | self._feed(parser, ">\n", chunk_size) | ||
30 | - self.assert_event_tags(parser, [('end', 'element')]) | ||
31 | + expected_events += [('end', 'element')] | ||
32 | self._feed(parser, "<element>text</element>tail\n", chunk_size) | ||
33 | self._feed(parser, "<empty-element/>\n", chunk_size) | ||
34 | - self.assert_event_tags(parser, [ | ||
35 | + expected_events += [ | ||
36 | ('end', 'element'), | ||
37 | ('end', 'empty-element'), | ||
38 | - ]) | ||
39 | + ] | ||
40 | self._feed(parser, "</root>\n", chunk_size) | ||
41 | - self.assert_event_tags(parser, [('end', 'root')]) | ||
42 | + expected_events += [('end', 'root')] | ||
43 | self.assertIsNone(parser.close()) | ||
44 | + self.assert_event_tags(parser, expected_events) | ||
45 | |||
46 | def test_feed_while_iterating(self): | ||
47 | parser = ET.XMLPullParser() | ||
48 | diff --git a/Misc/NEWS.d/next/Tests/2024-02-07-15-49-37.gh-issue-115133.WBajNr.rst b/Misc/NEWS.d/next/Tests/2024-02-07-15-49-37.gh-issue-115133.WBajNr.rst | ||
49 | new file mode 100644 | ||
50 | index 0000000..4dc9c13 | ||
51 | --- /dev/null | ||
52 | +++ b/Misc/NEWS.d/next/Tests/2024-02-07-15-49-37.gh-issue-115133.WBajNr.rst | ||
53 | @@ -0,0 +1 @@ | ||
54 | +Fix etree XMLPullParser tests for Expat >=2.6.0 with reparse deferral | ||
55 | -- | ||
56 | 2.43.0 | ||
57 | |||
diff --git a/meta/recipes-devtools/python/python3_3.12.1.bb b/meta/recipes-devtools/python/python3_3.12.1.bb index 1d3a4221c3..771902cd2c 100644 --- a/meta/recipes-devtools/python/python3_3.12.1.bb +++ b/meta/recipes-devtools/python/python3_3.12.1.bb | |||
@@ -30,6 +30,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ | |||
30 | file://0001-skip-no_stdout_fileno-test-due-to-load-variability.patch \ | 30 | file://0001-skip-no_stdout_fileno-test-due-to-load-variability.patch \ |
31 | file://0001-test_storlines-skip-due-to-load-variability.patch \ | 31 | file://0001-test_storlines-skip-due-to-load-variability.patch \ |
32 | file://0001-gh-114492-Initialize-struct-termios-before-calling-t.patch \ | 32 | file://0001-gh-114492-Initialize-struct-termios-before-calling-t.patch \ |
33 | file://0001-test_xml_etree.py-Fix-for-Expat-2.6.0-with-reparse-d.patch \ | ||
33 | " | 34 | " |
34 | 35 | ||
35 | SRC_URI:append:class-native = " \ | 36 | SRC_URI:append:class-native = " \ |