Skip to content

Commit de973a4

Browse files
committed
Remove 'cannot immortalize' tests.
1 parent a2afcbd commit de973a4

2 files changed

Lines changed: 0 additions & 59 deletions

File tree

Lib/test/test_capi/test_immortal.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -804,14 +804,6 @@ def linger():
804804
event.wait()
805805
self.assertTrue(hasattr(immortal, "cycle"))
806806

807-
@isolate(via_subprocess=True)
808-
def test_cannot_immortalize(self):
809-
import _testcapi
810-
811-
cannot_immortalize = _testcapi.CannotImmortalize()
812-
with self.assertRaises(TypeError):
813-
sys._immortalize(cannot_immortalize)
814-
815807
@support.requires_resource("cpu")
816808
@always_isolate
817809
def test_the_party_pack(self):

Modules/_testcapimodule.c

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3175,52 +3175,6 @@ create_manual_heap_type(void)
31753175
return (PyObject *)type;
31763176
}
31773177

3178-
typedef struct {
3179-
PyObject_HEAD;
3180-
} CannotImmortalize;
3181-
3182-
static PyTypeObject CannotImmortalize_Type = {
3183-
PyVarObject_HEAD_INIT(NULL, 0)
3184-
"cannot_immortalize",
3185-
sizeof(CannotImmortalize), /* tp_basicsize */
3186-
0, /* tp_itemsize */
3187-
0, /* destructor tp_dealloc */
3188-
0, /* tp_vectorcall_offset */
3189-
0, /* tp_getattr */
3190-
0, /* tp_setattr */
3191-
0, /* tp_as_async */
3192-
0, /* tp_repr */
3193-
0, /* tp_as_number */
3194-
0, /* tp_as_sequence */
3195-
0, /* tp_as_mapping */
3196-
0, /* tp_hash */
3197-
0, /* tp_call */
3198-
0, /* tp_str */
3199-
PyObject_GenericGetAttr, /* tp_getattro */
3200-
PyObject_GenericSetAttr, /* tp_setattro */
3201-
0, /* tp_as_buffer */
3202-
0, /* tp_flags */
3203-
"Type that does not support immortality",
3204-
0, /* traverseproc tp_traverse */
3205-
0, /* tp_clear */
3206-
0, /* tp_richcompare */
3207-
0, /* tp_weaklistoffset */
3208-
0, /* tp_iter */
3209-
0, /* tp_iternext */
3210-
0, /* tp_methods */
3211-
0, /* tp_members */
3212-
0,
3213-
0,
3214-
0,
3215-
0,
3216-
0,
3217-
0,
3218-
0,
3219-
0,
3220-
PyType_GenericNew, /* tp_new */
3221-
PyObject_Free, /* tp_free */
3222-
};
3223-
32243178
typedef struct {
32253179
PyObject_VAR_HEAD
32263180
} ManagedDictObject;
@@ -3335,11 +3289,6 @@ PyInit__testcapi(void)
33353289
Py_INCREF(&MethStatic_Type);
33363290
PyModule_AddObject(m, "MethStatic", (PyObject *)&MethStatic_Type);
33373291

3338-
if (PyType_Ready(&CannotImmortalize_Type) < 0)
3339-
return NULL;
3340-
Py_INCREF(&CannotImmortalize_Type);
3341-
PyModule_AddObject(m, "CannotImmortalize", (PyObject *)&CannotImmortalize_Type);
3342-
33433292
PyModule_AddObject(m, "CHAR_MAX", PyLong_FromLong(CHAR_MAX));
33443293
PyModule_AddObject(m, "CHAR_MIN", PyLong_FromLong(CHAR_MIN));
33453294
PyModule_AddObject(m, "UCHAR_MAX", PyLong_FromLong(UCHAR_MAX));

0 commit comments

Comments
 (0)