Skip to content

Commit 8728bd7

Browse files
committed
Remove superfluous C API test
1 parent 4a1bab6 commit 8728bd7

File tree

1 file changed

+0
-64
lines changed

1 file changed

+0
-64
lines changed

Modules/_testcapimodule.c

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2227,69 +2227,6 @@ test_datetime_capi(PyObject *self, PyObject *args) {
22272227
return NULL;
22282228
}
22292229

2230-
static PyObject *
2231-
test_datetime_timezone_capi(PyObject *self, PyObject *args) {
2232-
// Make sure the DateTimeAPI is initialized by running the test
2233-
if (!PyDateTimeAPI) {
2234-
if(test_datetime_capi(self, args) == NULL) {
2235-
return NULL;
2236-
}
2237-
}
2238-
2239-
if(!PyDateTimeAPI) {
2240-
PyErr_SetString(PyExc_ValueError, "No API initialized");
2241-
return NULL;
2242-
}
2243-
2244-
// Test that the UTC singleton is a time zone
2245-
if(!PyTZInfo_Check(PyDateTimeAPI->TimeZone_UTC)) {
2246-
PyErr_SetString(PyExc_AssertionError, "TimeZone_UTC is not a tzinfo subclass");
2247-
return NULL;
2248-
}
2249-
2250-
if(!PyTimeZone_Check(PyDateTimeAPI->TimeZone_UTC)) {
2251-
PyErr_SetString(PyExc_AssertionError, "TimeZone_UTC is not a TimeZoneType subclass");
2252-
return NULL;
2253-
}
2254-
2255-
2256-
if(!PyTimeZone_CheckExact(PyDateTimeAPI->TimeZone_UTC)) {
2257-
PyErr_SetString(PyExc_AssertionError, "TimeZone_UTC is not a TimeZoneType");
2258-
return NULL;
2259-
}
2260-
2261-
// Test the TimeZone objects API
2262-
PyObject *offset = PyDelta_FromDSU(0, -18000, 0);
2263-
PyObject *name = PyUnicode_FromString("EST");
2264-
2265-
PyObject *est_zone = PyDateTimeAPI->TimeZone_FromTimeZone(offset, name);
2266-
2267-
Py_DecRef(offset);
2268-
Py_DecRef(name);
2269-
2270-
if(!PyTZInfo_Check(est_zone)) {
2271-
PyErr_SetString(PyExc_AssertionError,
2272-
"TimeZone_FromTimeZone timezone is not a tzinfo subclass");
2273-
return NULL;
2274-
}
2275-
2276-
if(!PyTimeZone_Check(est_zone)) {
2277-
PyErr_SetString(PyExc_AssertionError,
2278-
"TimeZone_FromTimeZone timezone is not a TimeZoneType subclass");
2279-
return NULL;
2280-
}
2281-
2282-
if(!PyTimeZone_CheckExact(est_zone)) {
2283-
PyErr_SetString(PyExc_AssertionError,
2284-
"TimeZone_FromTimeZone did not return a TimeZoneType");
2285-
return NULL;
2286-
}
2287-
2288-
Py_DecRef(est_zone);
2289-
2290-
Py_RETURN_NONE;
2291-
}
2292-
22932230
/* Functions exposing the C API type checking for testing */
22942231
#define MAKE_DATETIME_CHECK_FUNC(check_method, exact_method) \
22952232
PyObject *obj; \
@@ -4584,7 +4521,6 @@ static PyMethodDef TestMethods[] = {
45844521
{"test_config", (PyCFunction)test_config, METH_NOARGS},
45854522
{"test_sizeof_c_types", (PyCFunction)test_sizeof_c_types, METH_NOARGS},
45864523
{"test_datetime_capi", test_datetime_capi, METH_NOARGS},
4587-
{"test_datetime_timezone_capi", test_datetime_timezone_capi, METH_NOARGS},
45884524
{"datetime_check_date", datetime_check_date, METH_VARARGS},
45894525
{"datetime_check_time", datetime_check_time, METH_VARARGS},
45904526
{"datetime_check_datetime", datetime_check_datetime, METH_VARARGS},

0 commit comments

Comments
 (0)