Skip to content

Commit 9e91e67

Browse files
committed
mark failing test_ctypes
1 parent eb71413 commit 9e91e67

File tree

11 files changed

+27
-4
lines changed

11 files changed

+27
-4
lines changed

Lib/test/test_ctypes/test_cast.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ def test_address2pointer(self):
3232
ptr = cast(address, POINTER(c_int))
3333
self.assertEqual([ptr[i] for i in range(3)], [42, 17, 2])
3434

35+
# TODO: RUSTPYTHON
36+
@unittest.expectedFailure
3537
def test_p2a_objects(self):
3638
array = (c_char_p * 5)()
3739
self.assertEqual(array._objects, None)

Lib/test/test_ctypes/test_internals.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ def test_ints(self):
2727
self.assertEqual(refcnt, sys.getrefcount(i))
2828
self.assertEqual(ci._objects, None)
2929

30+
# TODO: RUSTPYTHON
31+
@unittest.expectedFailure
3032
def test_c_char_p(self):
3133
s = "Hello, World".encode("ascii")
3234
refcnt = sys.getrefcount(s)
@@ -62,6 +64,8 @@ class Y(Structure):
6264
x1.a, x2.b = 42, 93
6365
self.assertEqual(y._objects, {"0": {}, "1": {}})
6466

67+
# TODO: RUSTPYTHON
68+
@unittest.expectedFailure
6569
def test_xxx(self):
6670
class X(Structure):
6771
_fields_ = [("a", c_char_p), ("b", c_char_p)]

Lib/test/test_ctypes/test_keeprefs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ def test_cint(self):
1212
x = c_int(99)
1313
self.assertEqual(x._objects, None)
1414

15+
# TODO: RUSTPYTHON
16+
@unittest.expectedFailure
1517
def test_ccharp(self):
1618
x = c_char_p()
1719
self.assertEqual(x._objects, None)
@@ -33,6 +35,8 @@ class X(Structure):
3335
x.b = 99
3436
self.assertEqual(x._objects, None)
3537

38+
# TODO: RUSTPYTHON
39+
@unittest.expectedFailure
3640
def test_ccharp_struct(self):
3741
class X(Structure):
3842
_fields_ = [("a", c_char_p),

Lib/test/test_ctypes/test_objects.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858

5959

6060
def load_tests(loader, tests, pattern):
61-
tests.addTest(doctest.DocTestSuite())
61+
# TODO: RUSTPYTHON - doctest disabled due to null terminator in _objects
62+
# tests.addTest(doctest.DocTestSuite())
6263
return tests
6364

6465

Lib/test/test_ctypes/test_python_api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88

99
class PythonAPITestCase(unittest.TestCase):
10+
# TODO: RUSTPYTHON
11+
@unittest.expectedFailure
1012
def test_PyBytes_FromStringAndSize(self):
1113
PyBytes_FromStringAndSize = pythonapi.PyBytes_FromStringAndSize
1214

@@ -57,6 +59,8 @@ def test_PyObj_FromPtr(self):
5759
del pyobj
5860
self.assertEqual(sys.getrefcount(s), ref)
5961

62+
# TODO: RUSTPYTHON
63+
@unittest.expectedFailure
6064
def test_PyOS_snprintf(self):
6165
PyOS_snprintf = pythonapi.PyOS_snprintf
6266
PyOS_snprintf.argtypes = POINTER(c_char), c_size_t, c_char_p

Lib/test/test_ctypes/test_random_things.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ def test_FloatDivisionError(self):
7070
with self.expect_unraisable(ZeroDivisionError):
7171
cb(0.0)
7272

73+
# TODO: RUSTPYTHON
74+
@unittest.expectedFailure
7375
def test_TypeErrorDivisionError(self):
7476
cb = CFUNCTYPE(c_int, c_char_p)(callback_func)
7577
err_msg = "unsupported operand type(s) for /: 'int' and 'bytes'"

Lib/test/test_ctypes/test_values.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,17 @@ def test_undefined(self):
3939
class PythonValuesTestCase(unittest.TestCase):
4040
"""This test only works when python itself is a dll/shared library"""
4141

42+
# TODO: RUSTPYTHON
43+
@unittest.expectedFailure
4244
def test_optimizeflag(self):
4345
# This test accesses the Py_OptimizeFlag integer, which is
4446
# exported by the Python dll and should match the sys.flags value
4547

4648
opt = c_int.in_dll(pythonapi, "Py_OptimizeFlag").value
4749
self.assertEqual(opt, sys.flags.optimize)
4850

51+
# TODO: RUSTPYTHON
52+
@unittest.expectedFailure
4953
def test_frozentable(self):
5054
# Python exports a PyImport_FrozenModules symbol. This is a
5155
# pointer to an array of struct _frozen entries. The end of the

Lib/test/test_ctypes/test_win32.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class FunctionCallTestCase(unittest.TestCase):
1717
@unittest.skipUnless('MSC' in sys.version, "SEH only supported by MSC")
1818
@unittest.skipIf(sys.executable.lower().endswith('_d.exe'),
1919
"SEH not enabled in debug builds")
20+
# TODO: RUSTPYTHON - SEH not implemented
21+
@unittest.skipIf("RustPython" in sys.version, "SEH not implemented in RustPython")
2022
def test_SEH(self):
2123
# Disable faulthandler to prevent logging the warning:
2224
# "Windows fatal exception: access violation"

Lib/test/test_ctypes/test_win32_com_foreign_func.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ class IPersist(IUnknown):
158158

159159
self.assertEqual(0, ppst.Release())
160160

161+
# TODO: RUSTPYTHON - COM iid parameter handling not implemented
162+
@unittest.expectedFailure
161163
def test_with_paramflags_and_iid(self):
162164
class IUnknown(c_void_p):
163165
QueryInterface = proto_query_interface(None, IID_IUnknown)

Lib/test/test_exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ def test_WindowsError(self):
430430

431431
@unittest.skipUnless(sys.platform == 'win32',
432432
'test specific to Windows')
433+
@unittest.expectedFailure # TODO: RUSTPYTHON
433434
def test_windows_message(self):
434435
"""Should fill in unknown error code in Windows error message"""
435436
ctypes = import_module('ctypes')

0 commit comments

Comments
 (0)