Skip to content

Commit ea48e40

Browse files
committed
python3-typing-inspection: skip test broken by CPython 3.13.15 Literal dedup
test_literal_values_unhashable_type asserts that duplicate unhashable Literal values (e.g. Literal[[1, 'a'], [1, 'a']]) are preserved, but CPython 3.13.15+ deduplicates unhashable Literal args at construction time (python/cpython#153914). Upstream fixed this the same way starting in 0.4.4 by skipping the test on newer Python; backport that same guard here since this recipe is pinned to 0.4.2. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 parent d89e202 commit ea48e40

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎meta-python/recipes-devtools/python/python3-typing-inspection_0.4.4.bb‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,16 @@ RDEPENDS:${PN}-ptest += "python3-typing-extensions"
1212

1313
PYPI_PACKAGE = "typing_inspection"
1414

15+
do_install_ptest:append() {
16+
# test_literal_values_unhashable_type asserts that duplicate unhashable
17+
# Literal values (e.g. Literal[[1, 'a'], [1, 'a']]) are preserved, but
18+
# CPython 3.13.15+ deduplicates unhashable Literal args at construction
19+
# time (https://github.com/python/cpython/pull/153914). Upstream fixed
20+
# this the same way starting in 0.4.4 by skipping the test on newer
21+
# Python; backport that same guard here since we're pinned to 0.4.2.
22+
sed -i \
23+
-e "/^def test_literal_values_unhashable_type/i @pytest.mark.skipif(sys.version_info >= (3, 13, 15), reason='Unhashable arguments are deduplicated (https://github.com/python/cpython/pull/153914)')" \
24+
${D}${PTEST_PATH}/tests/introspection/test_literal_values.py
25+
}
26+
1527
BBCLASSEXTEND += "native nativesdk"

0 commit comments

Comments
 (0)