Skip to content

Commit 4ed6a93

Browse files
committed
Make a test that was failing on CPython more lenient
1 parent c48067b commit 4ed6a93

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -580,16 +580,7 @@ def test_nb_add_sq_concat_static_managed_heap_inheritance():
580580

581581
# fixup_slot_dispatchers should figure out that __add__ and __radd__ descriptors wrap the same
582582
# native call and set nb_add to it instead of the Python dispatcher C function
583-
class IntermediateManagedDummy(NbAddSqConcatStaticType):
583+
class ManagedDummy(NbAddSqConcatStaticType):
584584
pass
585585

586-
# This should inherit my_nb_add as nb_add
587-
SqConcatInheritingNbAdd = CPyExtHeapType("SqConcatInheritingNbAdd",
588-
bases=(IntermediateManagedDummy,),
589-
code = 'PyObject* my_sq_concat(PyObject* self, PyObject *other) { return PyLong_FromLong(10); }',
590-
slots=['{Py_sq_concat, &my_sq_concat}'])
591-
592-
# Doing SqConcatInheritingNbAdd() + NbAddSqConcatStaticType() triggers segfault in CPython debug build
593-
# (not in the addition itself, but later in weakref processing). This test is derived from a fuzzer test
594-
# case, where it did not segfault...
595-
assert SlotsGetter.get_nb_add(NbAddSqConcatStaticType()) == SlotsGetter.get_nb_add(SqConcatInheritingNbAdd())
586+
assert SlotsGetter.get_nb_add(ManagedDummy()) == SlotsGetter.get_nb_add(NbAddSqConcatStaticType())

0 commit comments

Comments
 (0)