Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for Datetime C API Macros #81014

Closed
pganssle opened this issue May 7, 2019 · 4 comments
Closed

Add tests for Datetime C API Macros #81014

pganssle opened this issue May 7, 2019 · 4 comments
Assignees
Labels
3.9 only security fixes tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@pganssle
Copy link
Member

pganssle commented May 7, 2019

BPO 36833
Nosy @vstinner, @pganssle, @tonybaloney, @nanjekyejoannah, @SimiCode
PRs
  • bpo-36833: Add tests for Datetime C API Macros #14842
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/pganssle'
    closed_at = <Date 2019-08-29.12:55:19.529>
    created_at = <Date 2019-05-07.14:17:31.677>
    labels = ['type-feature', 'tests', '3.9']
    title = 'Add tests for Datetime C API Macros'
    updated_at = <Date 2019-08-29.12:55:19.528>
    user = 'https://github.com/pganssle'

    bugs.python.org fields:

    activity = <Date 2019-08-29.12:55:19.528>
    actor = 'vstinner'
    assignee = 'p-ganssle'
    closed = True
    closed_date = <Date 2019-08-29.12:55:19.529>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2019-05-07.14:17:31.677>
    creator = 'p-ganssle'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36833
    keywords = ['patch']
    message_count = 4.0
    messages = ['341731', '342235', '350771', '350772']
    nosy_count = 5.0
    nosy_names = ['vstinner', 'p-ganssle', 'anthony shaw', 'nanjekyejoannah', 'edison.abahurire']
    pr_nums = ['14842']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue36833'
    versions = ['Python 3.9']

    @pganssle
    Copy link
    Member Author

    pganssle commented May 7, 2019

    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.

    @pganssle pganssle self-assigned this May 7, 2019
    @pganssle pganssle added tests Tests in the Lib/test dir type-feature A feature request or enhancement labels May 7, 2019
    @simicode
    Copy link
    Mannequin

    simicode mannequin commented May 12, 2019

    I'm now working on this as pbo-36782 awaits merging.

    @nanjekyejoannah nanjekyejoannah added the 3.9 only security fixes label Jul 18, 2019
    @vstinner
    Copy link
    Member

    New changeset 2c5fb17 by Victor Stinner (Joannah Nanjekye) in branch 'master':
    bpo-36833: Add tests for Datetime C API Macros (GH-14842)
    2c5fb17

    @vstinner
    Copy link
    Member

    Thanks Joannah Nanjekye, well done ;-)

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes tests Tests in the Lib/test dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants