Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
001e4a6c
Commit
001e4a6c
authored
Dec 13, 2009
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a test of loading the datetime capi
parent
3095d20a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
Modules/_testcapimodule.c
Modules/_testcapimodule.c
+16
-0
No files found.
Modules/_testcapimodule.c
View file @
001e4a6c
...
...
@@ -8,6 +8,7 @@
#include "Python.h"
#include <float.h>
#include "structmember.h"
#include "datetime.h"
#ifdef WITH_THREAD
#include "pythread.h"
...
...
@@ -806,6 +807,20 @@ raise_exception(PyObject *self, PyObject *args)
#ifdef WITH_THREAD
static
PyObject
*
test_datetime_capi
(
PyObject
*
self
,
PyObject
*
args
)
{
if
(
PyDateTimeAPI
)
{
PyErr_SetString
(
PyExc_AssertionError
,
"PyDateTime_CAPI somehow initialized"
);
return
NULL
;
}
PyDateTime_IMPORT
;
if
(
PyDateTimeAPI
)
Py_RETURN_NONE
;
else
return
NULL
;
}
/* test_thread_state spawns a thread of its own, and that thread releases
* `thread_done` when it's finished. The driver code has to know when the
* thread finishes, because the thread uses a PyObject (the callable) that
...
...
@@ -1012,6 +1027,7 @@ code_newempty(PyObject *self, PyObject *args)
static
PyMethodDef
TestMethods
[]
=
{
{
"raise_exception"
,
raise_exception
,
METH_VARARGS
},
{
"test_config"
,
(
PyCFunction
)
test_config
,
METH_NOARGS
},
{
"test_datetime_capi"
,
test_datetime_capi
,
METH_NOARGS
},
{
"test_list_api"
,
(
PyCFunction
)
test_list_api
,
METH_NOARGS
},
{
"test_dict_iteration"
,
(
PyCFunction
)
test_dict_iteration
,
METH_NOARGS
},
{
"test_lazy_hash_inheritance"
,
(
PyCFunction
)
test_lazy_hash_inheritance
,
METH_NOARGS
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment