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

Increase filecmp test coverage from 63% to 76% #65556

Closed
dianaclarke opened this issue Apr 26, 2014 · 5 comments
Closed

Increase filecmp test coverage from 63% to 76% #65556

dianaclarke opened this issue Apr 26, 2014 · 5 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@dianaclarke
Copy link
Member

BPO 21357
Nosy @benjaminp, @merwok, @dianaclarke
Files
  • increase_filecmp_test_coverage.patch
  • increase_filecmp_test_coverage__updated_to_use_context_manager.patch
  • 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 2014-05-04.00:19:05.944>
    created_at = <Date 2014-04-26.14:50:05.817>
    labels = ['type-bug', 'library']
    title = 'Increase filecmp test coverage from 63% to 76%'
    updated_at = <Date 2014-05-04.14:44:38.860>
    user = 'https://github.com/dianaclarke'

    bugs.python.org fields:

    activity = <Date 2014-05-04.14:44:38.860>
    actor = 'diana'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-05-04.00:19:05.944>
    closer = 'python-dev'
    components = ['Library (Lib)']
    creation = <Date 2014-04-26.14:50:05.817>
    creator = 'diana'
    dependencies = []
    files = ['35045', '35047']
    hgrepos = []
    issue_num = 21357
    keywords = ['patch']
    message_count = 5.0
    messages = ['217201', '217211', '217222', '217849', '217876']
    nosy_count = 4.0
    nosy_names = ['benjamin.peterson', 'eric.araujo', 'python-dev', 'diana']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue21357'
    versions = ['Python 3.5']

    @dianaclarke
    Copy link
    Member Author

    • Increase filecmp test coverage from 63% to 76%

    • I left the testing style as-is, though it could probably be modernized.

    • I did not attempt to add coverage for 'funny_files', 'subdirs', etc, next pass perhaps.

    • Before:

    diana$ ./python.exe ../coveragepy report --show-missing
    Name Stmts Miss Cover Missing
    -------------------------------------------
    Lib/filecmp 163 61 63% 64, 80, 126, 130, 159-161, 164-166, 172, 174, 178-180, 190-194, 197-199, 203-224, 227-230, 233-236, 246, 293-302, 305

    • After:

    diana$ ./python.exe ../coveragepy report --show-missing
    Name Stmts Miss Cover Missing
    -------------------------------------------
    Lib/filecmp 163 39 76% 64, 80, 126, 130, 159-161, 164-166, 172, 174, 178-180, 192-194, 197-199, 217-218, 220-221, 223-224, 229-230, 235-236, 246, 293-302, 305

    Thoughts? Thanks!

    @dianaclarke dianaclarke added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Apr 26, 2014
    @benjaminp
    Copy link
    Contributor

    Thanks for the patch. I think you could use the support.catpured_stdout() context-manager in _assert_report. You should also sign the contributor agreement.

    @dianaclarke
    Copy link
    Member Author

    Nice, the support.catpured_stdout() context manager is much better.

    I've added a new patch with that change:

    increase_filecmp_test_coverage__updated_to_use_context_manager.patch
    

    Thanks for reviewing this, Benjamin!

    PS. I signed the contributor agreement.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 4, 2014

    New changeset 57dacba9febf by Benjamin Peterson in branch '3.4':
    improve test coverage of filecmp (closes bpo-21357)
    http://hg.python.org/cpython/rev/57dacba9febf

    New changeset c597654a7fd8 by Benjamin Peterson in branch 'default':
    merge 3.4 (bpo-21357)
    http://hg.python.org/cpython/rev/c597654a7fd8

    @python-dev python-dev mannequin closed this as completed May 4, 2014
    @dianaclarke
    Copy link
    Member Author

    Thanks Benjamin!

    @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
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants