- Add fix_test_generated_data.patch to skip failing test

(gh#python/cpython#121938).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python314?expand=0&rev=16
This commit is contained in:
Matej Cepl 2024-10-17 12:39:27 +00:00 committed by Git OBS Bridge
parent 3f3cf2ab15
commit a15f7b0fad
4 changed files with 39 additions and 12 deletions

View File

@ -17,18 +17,6 @@
started = []
def start_element(name, _):
--- a/Lib/test/test_sax.py
+++ b/Lib/test/test_sax.py
@@ -1241,6 +1241,9 @@ class ExpatReaderTest(XmlTestBase):
self.assertEqual(result.getvalue(), start + b"<doc></doc>")
+ @unittest.skipIf(pyexpat.version_info < (2, 6, 0),
+ f'Expat {pyexpat.version_info} does not '
+ 'support reparse deferral')
def test_flush_reparse_deferral_disabled(self):
result = BytesIO()
xmlgen = XMLGenerator(result)
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -121,6 +121,11 @@ ATTLIST_XML = """\

View File

@ -0,0 +1,34 @@
---
Lib/test/test_ctypes/test_generated_structs.py | 7 +++++++
1 file changed, 7 insertions(+)
--- a/Lib/test/test_ctypes/test_generated_structs.py
+++ b/Lib/test/test_ctypes/test_generated_structs.py
@@ -12,6 +12,7 @@ Run this module to regenerate the files:
import unittest
from test.support import import_helper
import re
+import sys
from dataclasses import dataclass
from functools import cached_property
@@ -21,6 +22,11 @@ from ctypes import sizeof, alignment, po
_ctypes_test = import_helper.import_module("_ctypes_test")
+def is_32bit():
+ # or alternatively (slightly slower)
+ # (struct.calcsize("P") * 8) == 32
+ return not (sys.maxsize > 2**32)
+
# ctypes erases the difference between `c_int` and e.g.`c_int16`.
# To keep it, we'll use custom subclasses with the C name stashed in `_c_name`:
class c_bool(ctypes.c_bool):
@@ -415,6 +421,7 @@ class AnonBitfields(Structure):
class GeneratedTest(unittest.TestCase):
+ @unittest.skipIf(is_32bit(), 'fails on 32bit platform (gh#python/cpython#121938)')
def test_generated_data(self):
"""Check that a ctypes struct/union matches its C equivalent.

View File

@ -23,6 +23,8 @@ Wed Oct 16 07:00:15 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
- Add fix_test_ftp_error.patch to mark test_ftp_error as
requiring network access, and explicitly declare we have no
network.
- Add fix_test_generated_data.patch to skip failing test
(gh#python/cpython#121938).
-------------------------------------------------------------------
Thu Oct 10 11:18:19 UTC 2024 - Matej Cepl <mcepl@cepl.eu>

View File

@ -215,6 +215,9 @@ Patch41: gh125535-Lib_IntVector_Intrinsics_vec128.patch
# PATCH-FIX-UPSTREAM fix_test_ftp_error.patch gh#python/cpython#125584 mcepl@suse.com
# Patch from gh#python/cpython!125586
Patch42: fix_test_ftp_error.patch
# PATCH-FIX-UPSTREAM fix_test_generated_data.patch gh#python/cpython#121938 mcepl@suse.com
# skip the failing test on 32bit arch
Patch43: fix_test_generated_data.patch
BuildRequires: autoconf-archive
BuildRequires: automake
BuildRequires: fdupes