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

IDLE list.append calltips test failures #60859

Closed
cjerdonek opened this issue Dec 10, 2012 · 5 comments
Closed

IDLE list.append calltips test failures #60859

cjerdonek opened this issue Dec 10, 2012 · 5 comments
Labels
topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@cjerdonek
Copy link
Member

BPO 16655
Nosy @terryjreedy, @kbkaiser, @cjerdonek
Dependencies
  • bpo-20122: Move CallTips tests to idle_tests
  • 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-01-21.08:17:52.220>
    created_at = <Date 2012-12-10.02:31:20.491>
    labels = ['expert-IDLE', 'type-bug']
    title = 'IDLE list.append calltips test failures'
    updated_at = <Date 2014-01-21.08:17:52.219>
    user = 'https://github.com/cjerdonek'

    bugs.python.org fields:

    activity = <Date 2014-01-21.08:17:52.219>
    actor = 'terry.reedy'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-01-21.08:17:52.220>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2012-12-10.02:31:20.491>
    creator = 'chris.jerdonek'
    dependencies = ['20122']
    files = []
    hgrepos = []
    issue_num = 16655
    keywords = []
    message_count = 5.0
    messages = ['177253', '177524', '177633', '208627', '208629']
    nosy_count = 4.0
    nosy_names = ['terry.reedy', 'kbk', 'chris.jerdonek', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue16655'
    versions = ['Python 3.3', 'Python 3.4']

    @cjerdonek
    Copy link
    Member Author

    There are three IDLE test failures in the 3.2 branch:

    $ ./python.exe Lib/idlelib/CallTips.py
    list.append - expected
    'L.append(object) -> None -- append object to end'
     - but got
    'L.append(object) -- append object to end'
    [].append - expected
    'L.append(object) -> None -- append object to end'
     - but got
    'L.append(object) -- append object to end'
    List.append - expected
    'L.append(object) -> None -- append object to end'
     - but got
    'L.append(object) -- append object to end'
    3 of 41 tests failed

    @cjerdonek cjerdonek added topic-IDLE type-bug An unexpected behavior, bug, or error labels Dec 10, 2012
    @terryjreedy
    Copy link
    Member

    In 3.2.3
    >>> list.append.__doc__
    'L.append(object) -- append object to end'
    
    In 3.3.0
    >>> list.append.__doc__
    'L.append(object) -> None -- append object to end'

    I checked the other 6 pure mutation methods.
    .sort, .extend, .remove, and the new .clear have the same new addition of ' -> None'.
    .insert and .reverse do not (but it seems they should).

    It seems I pushed the June 7 bpo-12510 patch -- msg162510 -- which added the .append tests, without properly testing in 3.2. A fix for 3.2 is easy, but the deeper issue is the fragility of comparing external text to hard-coded expected text. I knew when I wrote the tests that that could and would be a problem in the future, but did not notice that it already was.

    One solution is not to compare again external strings; but then how do we know that the tooltips work with such? Another is to fetch the external string in the test code, but that amounts to duplicating the code in the tooltip function and testing it against itself; so is it really a test? The third option is to leave the tests vulnerable and patch them in a version specific manner when they break.

    @cjerdonek
    Copy link
    Member Author

    Could you mock or monkey-patch what you are getting a tool tip for (i.e. set the "external" string you are checking for)?

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jan 21, 2014

    New changeset 779e5511d803 by Terry Jan Reedy in branch '2.7':
    Issue bpo-16655: Explain why Idle's test_calltips has 'fragile' tests of builtins.
    http://hg.python.org/cpython/rev/779e5511d803

    New changeset 4a505a901b2e by Terry Jan Reedy in branch '3.3':
    Issue bpo-16655: Explain why Idle's test_calltips has 'fragile' tests of builtins.
    http://hg.python.org/cpython/rev/4a505a901b2e

    New changeset c4a2d0538441 by Terry Jan Reedy in branch 'default':
    Issue bpo-16655: Explain why Idle's test_calltips has 'fragile' tests of builtins.
    http://hg.python.org/cpython/rev/c4a2d0538441

    @terryjreedy
    Copy link
    Member

    When I moved tests from CallTips.py to test_calltips.py, I reduced but did not eliminate the use of builtins. I decided instead to explain in the file why there is no substitute for the real thing, and how to fix a simple mismatch like that reported here.

    @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
    topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants