This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add tests for Datetime C API Macros
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: p-ganssle Nosy List: anthony shaw, edison.abahurire, nanjekyejoannah, p-ganssle, vstinner
Priority: normal Keywords: patch

Created on 2019-05-07 14:17 by p-ganssle, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 14842 merged nanjekyejoannah, 2019-07-18 14:50
Messages (4)
msg341731 - (view) Author: Paul Ganssle (p-ganssle) * (Python committer) Date: 2019-05-07 14:17
This is a child issue for bpo 36782, specifically for testing the macro-only datetime C API functions

Untested macros with no corresponding API module:

- PyDateTime_GET_YEAR
- PyDateTime_GET_MONTH
- PyDateTime_GET_DAY
- PyDateTime_DATE_GET_HOUR
- PyDateTime_DATE_GET_MINUTE
- PyDateTime_DATE_GET_SECOND
- PyDateTime_DATE_GET_MICROSECOND

- PyDateTime_TIME_GET_HOUR
- PyDateTime_TIME_GET_MINUTE
- PyDateTime_TIME_GET_SECOND
- PyDateTime_TIME_GET_MICROSECOND

- PyDateTime_DELTA_GET_DAYS
- PyDateTime_DELTA_GET_SECONDS
- PyDateTime_DELTA_GET_MICROSECONDS

For all of these, I think you can write one "wrapper function" that just extracts all fields as a tuple (4 C API wrapper functions - date, datetime, time, timedelta).

For each function, test with both the standard class and a subclass.
msg342235 - (view) Author: Edison Abahurire (edison.abahurire) * Date: 2019-05-12 01:54
I'm now working on this as pbo-36782 awaits merging.
msg350771 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-08-29 12:54
New changeset 2c5fb1711818926862d0d7b2e5effcaa5a5eb002 by Victor Stinner (Joannah Nanjekye) in branch 'master':
bpo-36833: Add tests for Datetime C API Macros (GH-14842)
https://github.com/python/cpython/commit/2c5fb1711818926862d0d7b2e5effcaa5a5eb002
msg350772 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-08-29 12:55
Thanks Joannah Nanjekye, well done ;-)
History
Date User Action Args
2022-04-11 14:59:14adminsetgithub: 81014
2019-08-29 12:55:19vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg350772

stage: patch review -> resolved
2019-08-29 12:54:49vstinnersetnosy: + vstinner
messages: + msg350771
2019-07-18 14:50:11nanjekyejoannahsetkeywords: + patch
stage: patch review
pull_requests: + pull_request14633
2019-07-18 14:41:10nanjekyejoannahsetnosy: + nanjekyejoannah

versions: + Python 3.9
2019-05-12 01:54:41edison.abahuriresetnosy: + anthony shaw
messages: + msg342235
2019-05-07 14:17:31p-gansslecreate