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

test_name_error_suggestions_do_not_trigger_for_too_many_locals: AssertionError: 'a1' unexpectedly found in Traceback #89563

Closed
hroncok mannequin opened this issue Oct 7, 2021 · 6 comments
Labels
3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir

Comments

@hroncok
Copy link
Mannequin

hroncok mannequin commented Oct 7, 2021

BPO 45400
Nosy @vstinner, @hroncok, @pablogsal, @miss-islington
PRs
  • bpo-45400: Fix suggestion test of test_exceptions #28783
  • bpo-45400: Fix test_name_error_suggestions_do_not_trigger_for_too_many_locals on a1 releases #28784
  • [3.10] bpo-45400: Fix suggestion test of test_exceptions (GH-28783) #28787
  • 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 2021-10-07.13:54:47.153>
    created_at = <Date 2021-10-07.09:47:27.673>
    labels = ['tests', '3.10', '3.11']
    title = "test_name_error_suggestions_do_not_trigger_for_too_many_locals: AssertionError: 'a1' unexpectedly found in Traceback"
    updated_at = <Date 2021-10-07.13:54:47.153>
    user = 'https://github.com/hroncok'

    bugs.python.org fields:

    activity = <Date 2021-10-07.13:54:47.153>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-10-07.13:54:47.153>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2021-10-07.09:47:27.673>
    creator = 'hroncok'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45400
    keywords = ['patch']
    message_count = 6.0
    messages = ['403370', '403374', '403388', '403394', '403398', '403399']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'hroncok', 'pablogsal', 'miss-islington']
    pr_nums = ['28783', '28784', '28787']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue45400'
    versions = ['Python 3.10', 'Python 3.11']

    @hroncok
    Copy link
    Mannequin Author

    hroncok mannequin commented Oct 7, 2021

    The test_name_error_suggestions_do_not_trigger_for_too_many_locals test fails with the to-be-released 3.11.0a1:

    ======================================================================
    FAIL: test_name_error_suggestions_do_not_trigger_for_too_many_locals (test.test_exceptions.NameErrorTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/builddir/build/BUILD/Python-3.11.0a1/Lib/test/test_exceptions.py", line 1843, in test_name_error_suggestions_do_not_trigger_for_too_many_locals
        self.assertNotIn("a1", err.getvalue())
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: 'a1' unexpectedly found in 'Traceback (most recent call last):\n  File "/builddir/build/BUILD/Python-3.11.0a1/Lib/test/test_exceptions.py", line 1838, in test_name_error_suggestions_do_not_trigger_for_too_many_locals\n    f()\n    ^^^\n  File "/builddir/build/BUILD/Python-3.11.0a1/Lib/test/test_exceptions.py", line 1835, in f\n    print(a0)\n          ^^\nNameError: name \'a0\' is not defined\n'

    Ran 1 test in 0.016s

    I believe it is the version string that triggers this failure.

    @hroncok hroncok mannequin added 3.11 only security fixes labels Oct 7, 2021
    @hroncok
    Copy link
    Mannequin Author

    hroncok mannequin commented Oct 7, 2021

    I see this was previously added to 3.10 beta, so this never triggered. The test only fails when building from a directory that contains the full Python version.

    @hroncok hroncok mannequin added tests Tests in the Lib/test dir labels Oct 7, 2021
    @hroncok
    Copy link
    Mannequin Author

    hroncok mannequin commented Oct 7, 2021

    I am working on a fix

    @vstinner
    Copy link
    Member

    vstinner commented Oct 7, 2021

    New changeset 4e60566 by Victor Stinner in branch 'main':
    bpo-45400: Fix suggestion test of test_exceptions (GH-28783)
    4e60566

    @vstinner
    Copy link
    Member

    vstinner commented Oct 7, 2021

    I am working on a fix

    Or, I missed your message. You wrote it 4 minutes before I created my PR :-)

    @miss-islington
    Copy link
    Contributor

    New changeset d55bf81 by Miss Islington (bot) in branch '3.10':
    bpo-45400: Fix suggestion test of test_exceptions (GH-28783)
    d55bf81

    @vstinner vstinner added the 3.10 only security fixes label Oct 7, 2021
    @vstinner vstinner closed this as completed Oct 7, 2021
    @vstinner vstinner added the 3.10 only security fixes label Oct 7, 2021
    @vstinner vstinner closed this as completed Oct 7, 2021
    @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.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants