diff mbox series

[meta-python,3/5] python3-parse-type: fix test_numbered ptest with parse 1.22.2

Message ID 20261015043859.3073445-3-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-networking,1/5] openl2tp: fix rpcbind status check in run-ptest | expand

Commit Message

Khem Raj Oct. 15, 2026, 4:38 a.m. UTC
parse 1.22.2 made {:f} also accept nan/inf, which changed the generated
regex. Update the copied parse test expectation to match.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 ...e-1.22.2-float-pattern-in-test_numbe.patch | 37 +++++++++++++++++++
 .../python/python3-parse-type_0.6.6.bb        |  1 +
 2 files changed, 38 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-parse-type/0002-tests-match-parse-1.22.2-float-pattern-in-test_numbe.patch
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-parse-type/0002-tests-match-parse-1.22.2-float-pattern-in-test_numbe.patch b/meta-python/recipes-devtools/python/python3-parse-type/0002-tests-match-parse-1.22.2-float-pattern-in-test_numbe.patch
new file mode 100644
index 0000000000..8860080c38
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-parse-type/0002-tests-match-parse-1.22.2-float-pattern-in-test_numbe.patch
@@ -0,0 +1,37 @@ 
+From d3ba98005ddf52d739d2e9056b53ec2f7884ef8b Mon Sep 17 00:00:00 2001
+From: Khem Raj <khem.raj@oss.qualcomm.com>
+Date: Thu, 1 Oct 2026 07:00:36 +0000
+Subject: [PATCH] tests: match parse 1.22.2 float pattern in test_numbered
+
+tests/parse_tests/ is a copy of the test suite of the external parse
+module, run against whichever parse is installed. parse 1.22.2 (issue249)
+made {:f} also accept nan/inf, so the generated regex for "{0:f} {1:f}"
+changed and the copied test_numbered expectation no longer matches.
+
+Update the expectation to the one parse 1.22.2's own tests/test_pattern.py
+uses.
+
+Upstream-Status: Pending
+
+AI-Generated: Uses Claude Code
+Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
+---
+ tests/parse_tests/test_pattern.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/tests/parse_tests/test_pattern.py b/tests/parse_tests/test_pattern.py
+index abc19d6..039ebde 100644
+--- a/tests/parse_tests/test_pattern.py
++++ b/tests/parse_tests/test_pattern.py
+@@ -33,7 +33,10 @@ def test_named_typed():
+ def test_numbered():
+     _test_expression("{0}", r"(.+?)")
+     _test_expression("{0} {1}", r"(.+?) (.+?)")
+-    _test_expression("{0:f} {1:f}", r"([-+ ]?\d*\.\d+) ([-+ ]?\d*\.\d+)")
++    _test_expression(
++        "{0:f} {1:f}",
++        r"([-+ ]?(?:\d*\.\d+|nan|NAN|inf|INF)) ([-+ ]?(?:\d*\.\d+|nan|NAN|inf|INF))",
++    )
+
+
+ def test_bird():
diff --git a/meta-python/recipes-devtools/python/python3-parse-type_0.6.6.bb b/meta-python/recipes-devtools/python/python3-parse-type_0.6.6.bb
index 86f01f12db..075d32de1a 100644
--- a/meta-python/recipes-devtools/python/python3-parse-type_0.6.6.bb
+++ b/meta-python/recipes-devtools/python/python3-parse-type_0.6.6.bb
@@ -7,6 +7,7 @@  SRC_URI[sha256sum] = "513a3784104839770d690e04339a8b4d33439fcd5dd99f2e4580f9fc10
 SRC_URI += " \
     file://run-ptest \
     file://0001-drop-the-six-dependency.patch \
+    file://0002-tests-match-parse-1.22.2-float-pattern-in-test_numbe.patch \
 "

 inherit pypi ptest python_setuptools_build_meta