Skip to content

Commit 63e4f6e

Browse files
committed
[GR-52896] Enable cpyext/test_object on Windows.
PullRequest: graalpython/3269
2 parents e945a20 + 4597e13 commit 63e4f6e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

graalpython/com.oracle.graal.python.test/src/tests/cpyext/test_object.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@
3838
# SOFTWARE.
3939

4040
import sys
41+
from unittest import skipIf
4142

4243
from . import CPyExtType, CPyExtTestCase, CPyExtFunction, unhandled_error_compare, assert_raises
4344

4445
__dir__ = __file__.rpartition("/")[0]
46+
is_windows = sys.platform == "win32"
4547

4648

4749
def _reference_bytes(args):
@@ -328,10 +330,9 @@ def test_managed_class_with_native_base(self):
328330
NativeModule = CPyExtType("NativeModule_",
329331
'''
330332
PyTypeObject NativeBase_Type = {
331-
PyVarObject_HEAD_INIT(&PyType_Type, 0)
333+
.ob_base = PyVarObject_HEAD_INIT(NULL, 0)
332334
.tp_name = "NativeModule_.NativeBase",
333335
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
334-
.tp_base = &PyModule_Type,
335336
};
336337
337338
static PyObject* get_NativeBase_type(PyObject* cls) {
@@ -342,6 +343,8 @@ def test_managed_class_with_native_base(self):
342343
tp_methods='''{"get_NativeBase_type", (PyCFunction)get_NativeBase_type, METH_NOARGS | METH_CLASS, ""}''',
343344
ready_code='''
344345
/* testing lazy type initialization */
346+
NativeBase_Type.tp_base = &PyModule_Type; // because of MSVC..
347+
NativeBase_Type.ob_base.ob_base.ob_type = &PyType_Type;
345348
// if (PyType_Ready(&NativeBase_Type) < 0)
346349
// return NULL;
347350
''',
@@ -1424,6 +1427,7 @@ def test_take_ownership(self):
14241427
obj.clear_value()
14251428
assert value == (1, 2, 3, "hello", "world", dummy)
14261429

1430+
@skipIf(is_windows) # GR-52900
14271431
def test_async_slots(self):
14281432
import asyncio, types, functools
14291433
TestTpAsync = CPyExtType("TestTpAsync",

mx.graalpython/mx_graalpython.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,6 @@ def graalpython_gate_runner(args, tasks):
13911391
"*/cpyext/test_memoryview.py",
13921392
"*/cpyext/test_misc.py",
13931393
"*/cpyext/test_mmap.py",
1394-
"*/cpyext/test_object.py",
13951394
"*/cpyext/test_slice.py",
13961395
"*/cpyext/test_shutdown.py",
13971396
"*/cpyext/test_thread.py",

0 commit comments

Comments
 (0)