summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-cbor2/0001-fix-test-parameterization.patch
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2026-04-13 17:22:51 +0200
committerGyorgy Sarvari <skandigraun@gmail.com>2026-04-13 17:30:24 +0200
commit6971622747f2c9ce00428f14340068edcacc8d79 (patch)
treea03927ce9a56038813385461269c378808cbf85d /meta-python/recipes-devtools/python/python3-cbor2/0001-fix-test-parameterization.patch
parent5fcddafe237015a0bf9852dcf013b17fb3c6df2b (diff)
downloadmeta-openembedded-6971622747f2c9ce00428f14340068edcacc8d79.tar.gz
python3-cbor2: more patch indent and test fixes
Similar to a previous patch, the CVE-2025-68131 patch contained some more indentation errors, in the tests. Also, the backported tests were inserted between an existing test and its parameters - a new patch corrects that. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-cbor2/0001-fix-test-parameterization.patch')
-rw-r--r--meta-python/recipes-devtools/python/python3-cbor2/0001-fix-test-parameterization.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-cbor2/0001-fix-test-parameterization.patch b/meta-python/recipes-devtools/python/python3-cbor2/0001-fix-test-parameterization.patch
new file mode 100644
index 0000000000..db5f4c6250
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-cbor2/0001-fix-test-parameterization.patch
@@ -0,0 +1,48 @@
1From ff1a6be09b6856b34b30b00542a06819402094c6 Mon Sep 17 00:00:00 2001
2From: Gyorgy Sarvari <skandigraun@gmail.com>
3Date: Mon, 13 Apr 2026 17:16:43 +0200
4Subject: [PATCH] fix test parameterization
5
6The patch for CVE-2025-68131 backported the tests in a way
7that inserted a new, not-parameterized test between another
8parameterized test and this test's parameters. Due to this
9the parameters were associated with the incorrect test, failing
10the execution.
11
12Fix that.
13
14Upstream-Status: Backport [https://github.com/agronholm/cbor2/commit/f1d701cd2c411ee40bb1fe383afe7f365f35abf0]
15Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
16---
17 tests/test_decoder.py | 11 ++++++-----
18 1 file changed, 6 insertions(+), 5 deletions(-)
19
20diff --git a/tests/test_decoder.py b/tests/test_decoder.py
21index cc3af11..f9b7a11 100644
22--- a/tests/test_decoder.py
23+++ b/tests/test_decoder.py
24@@ -709,11 +709,6 @@ def test_reserved_special_tags(impl, data, expected):
25 assert exc_info.value.args[0] == "Undefined Reserved major type 7 subtype 0x" + expected
26
27
28-@pytest.mark.parametrize('data, expected', [
29- ('c400', '4'), ('c500', '5')
30- ],
31-)
32-
33 class TestDecoderReuse:
34 """
35 Tests for correct behavior when reusing CBORDecoder instances.
36@@ -775,6 +770,12 @@ class TestDecoderReuse:
37 assert result == ["hello", "hello"]
38 assert result[0] is result[1] # Same object reference
39
40+
41+@pytest.mark.parametrize('data, expected', [
42+ ('c400', '4'), ('c500', '5')
43+ ],
44+)
45+
46 def test_decimal_payload_unpacking(impl, data, expected):
47 with pytest.raises(impl.CBORDecodeValueError) as exc_info:
48 impl.loads(unhexlify(data))