This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: test_name_error_suggestions_do_not_trigger_for_too_many_locals: AssertionError: 'a1' unexpectedly found in Traceback
Type: Stage: resolved
Components: Tests Versions: Python 3.11, Python 3.10
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: hroncok, miss-islington, pablogsal, vstinner
Priority: normal Keywords: patch

Created on 2021-10-07 09:47 by hroncok, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 28783 merged vstinner, 2021-10-07 11:14
PR 28784 closed hroncok, 2021-10-07 11:22
PR 28787 merged miss-islington, 2021-10-07 11:47
Messages (6)
msg403370 - (view) Author: Miro Hrončok (hroncok) * Date: 2021-10-07 09:47
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/", 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/", 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/", 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.
msg403374 - (view) Author: Miro Hrončok (hroncok) * Date: 2021-10-07 09:49
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.
msg403388 - (view) Author: Miro Hrončok (hroncok) * Date: 2021-10-07 11:10
I am working on a fix
msg403394 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-10-07 11:47
New changeset 4e605666b08b8f863cbbbdaa34bb06988e648d26 by Victor Stinner in branch 'main':
bpo-45400: Fix suggestion test of test_exceptions (GH-28783)
msg403398 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-10-07 11:59
> I am working on a fix

Or, I missed your message. You wrote it 4 minutes before I created my PR :-)
msg403399 - (view) Author: miss-islington (miss-islington) Date: 2021-10-07 12:11
New changeset d55bf81c4ee2dcdd5dfa3b5a9905a0b32ca8d38b by Miss Islington (bot) in branch '3.10':
bpo-45400: Fix suggestion test of test_exceptions (GH-28783)
Date User Action Args
2022-04-11 14:59:50adminsetgithub: 89563
2021-10-07 13:54:47vstinnersetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.10
2021-10-07 12:11:42miss-islingtonsetmessages: + msg403399
2021-10-07 11:59:42vstinnersetmessages: + msg403398
2021-10-07 11:47:32miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request27122
2021-10-07 11:47:27vstinnersetmessages: + msg403394
2021-10-07 11:22:16hroncoksetpull_requests: + pull_request27119
2021-10-07 11:14:44vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request27118
2021-10-07 11:10:00hroncoksetmessages: + msg403388
2021-10-07 10:00:37hroncoksetcomponents: + Tests
2021-10-07 09:49:35hroncoksetmessages: + msg403374
2021-10-07 09:47:27hroncokcreate