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

Tests for leapdays in calendar.py module #53607

Closed
JohnChandler mannequin opened this issue Jul 23, 2010 · 3 comments
Closed

Tests for leapdays in calendar.py module #53607

JohnChandler mannequin opened this issue Jul 23, 2010 · 3 comments
Labels
tests Tests in the Lib/test dir

Comments

@JohnChandler
Copy link
Mannequin

JohnChandler mannequin commented Jul 23, 2010

BPO 9361
Nosy @bitdancer, @sandrotosi
Files
  • test_calendar.diff
  • 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 = None
    closed_at = <Date 2010-12-31.19:32:43.122>
    created_at = <Date 2010-07-23.18:58:41.266>
    labels = ['tests']
    title = 'Tests for leapdays in calendar.py module'
    updated_at = <Date 2010-12-31.19:32:43.119>
    user = 'https://bugs.python.org/JohnChandler'

    bugs.python.org fields:

    activity = <Date 2010-12-31.19:32:43.119>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-12-31.19:32:43.122>
    closer = 'r.david.murray'
    components = ['Tests']
    creation = <Date 2010-07-23.18:58:41.266>
    creator = 'John.Chandler'
    dependencies = []
    files = ['18161']
    hgrepos = []
    issue_num = 9361
    keywords = ['patch']
    message_count = 3.0
    messages = ['111373', '124969', '124974']
    nosy_count = 3.0
    nosy_names = ['r.david.murray', 'sandro.tosi', 'John.Chandler']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue9361'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    @JohnChandler
    Copy link
    Mannequin Author

    JohnChandler mannequin commented Jul 23, 2010

    Hi,

    Attaching a patch for the test_calendar.py file.

    Adds four tests to provide coverage of the leapdays() function.

    John

    @JohnChandler JohnChandler mannequin added the tests Tests in the Lib/test dir label Jul 23, 2010
    @sandrotosi
    Copy link
    Contributor

    I just tried John's patch, and:

    • it still applies without problem (except for a bit of offset)
    • I can confirm that it actually adds test coverage for leapdays() function (bringing calendar coverage from 71% to 72%).

    I think it would be good to apply it to py3k branch.

    Cheers,
    Sandro

    @bitdancer
    Copy link
    Member

    Applied in r87590. I threw in an extra test for a multi-leapyear-range. Since there was no reason not to, I backported it to 3.1 in r87591 and 2.7 in r87592. In the latter two commits I also backported the bpo-9342 patch.

    Thanks for the patch, John, and for the review, Sandro.

    @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
    tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants