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

Enhancing IDLE's test_delegator.py unit test #68165

Closed
AlSweigart mannequin opened this issue Apr 16, 2015 · 3 comments
Closed

Enhancing IDLE's test_delegator.py unit test #68165

AlSweigart mannequin opened this issue Apr 16, 2015 · 3 comments
Assignees
Labels
tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@AlSweigart
Copy link
Mannequin

AlSweigart mannequin commented Apr 16, 2015

BPO 23977
Nosy @terryjreedy
Files
  • test_delegator.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 = 'https://github.com/terryjreedy'
    closed_at = <Date 2016-05-16.02:08:11.142>
    created_at = <Date 2015-04-16.22:18:37.315>
    labels = ['type-feature', 'tests']
    title = "Enhancing IDLE's test_delegator.py unit test"
    updated_at = <Date 2016-05-16.02:08:11.141>
    user = 'https://bugs.python.org/AlSweigart'

    bugs.python.org fields:

    activity = <Date 2016-05-16.02:08:11.141>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2016-05-16.02:08:11.142>
    closer = 'terry.reedy'
    components = ['Tests']
    creation = <Date 2015-04-16.22:18:37.315>
    creator = 'Al.Sweigart'
    dependencies = []
    files = ['39078']
    hgrepos = []
    issue_num = 23977
    keywords = ['patch']
    message_count = 3.0
    messages = ['241284', '265584', '265659']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'python-dev', 'Al.Sweigart']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue23977'
    versions = ['Python 3.5', 'Python 3.6']

    @AlSweigart
    Copy link
    Mannequin Author

    AlSweigart mannequin commented Apr 16, 2015

    As part of trying to understand the IDLE codebase, I'm taking a look at IDLE's unit tests.

    -Added more specific messages when test_delegator.py's assertions fail.
    -Added detail to the comments.
    -Added an explicit test of the resetcache() method (which before was only tested as far as it was called when setdelegate() was called).

    I've rerun the unit test on the existing source code and it passes.

    @AlSweigart AlSweigart mannequin added tests Tests in the Lib/test dir type-feature A feature request or enhancement labels Apr 16, 2015
    @terryjreedy
    Copy link
    Member

    The patch adds too much. Some of the comments are too obvious. See PEP-8. Many of the messages repeat the information already provided in the custom messages already provided by the assertXyz failure methods. For instance, when assertEqual(a, b) fails, the message already prints out something like "%s != $s" % (repr(a), repr(b)). Perhaps you were not familiar with this. One of the problems of retrofitting tests is that we do not see the default failure messages.

    In any case, over-commenting and over-messaging are not harmless as they make code and failure messages harder, not easier to read. I will review and add what I think is useful.

    @terryjreedy terryjreedy self-assigned this May 15, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 16, 2016

    New changeset 6bc08af57813 by Terry Jan Reedy in branch '3.5':
    Issue bpo-23977: Tweak IDLE Delegator and its test.
    https://hg.python.org/cpython/rev/6bc08af57813

    @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 type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant