@@ -2227,69 +2227,6 @@ test_datetime_capi(PyObject *self, PyObject *args) {
2227
2227
return NULL ;
2228
2228
}
2229
2229
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
-
2293
2230
/* Functions exposing the C API type checking for testing */
2294
2231
#define MAKE_DATETIME_CHECK_FUNC (check_method , exact_method ) \
2295
2232
PyObject *obj; \
@@ -4584,7 +4521,6 @@ static PyMethodDef TestMethods[] = {
4584
4521
{"test_config" , (PyCFunction )test_config , METH_NOARGS },
4585
4522
{"test_sizeof_c_types" , (PyCFunction )test_sizeof_c_types , METH_NOARGS },
4586
4523
{"test_datetime_capi" , test_datetime_capi , METH_NOARGS },
4587
- {"test_datetime_timezone_capi" , test_datetime_timezone_capi , METH_NOARGS },
4588
4524
{"datetime_check_date" , datetime_check_date , METH_VARARGS },
4589
4525
{"datetime_check_time" , datetime_check_time , METH_VARARGS },
4590
4526
{"datetime_check_datetime" , datetime_check_datetime , METH_VARARGS },
0 commit comments