GeezerVison is showing github.com — gh-99894: Ensure the local names don't collide with the test file in traceback suggestion error checking by pablogsal · Pull Request #99895 · python/cpython
Conversation
pablogsal
commented
Nov 30, 2022
•
edited by bedevere-bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…le in traceback suggestion error checking
|
This branch doesn't work for me:
vstinner@mona$ ./python -m test test_traceback -j20 -F -m test_import_from_error_bad_suggestions_do_not_trigger_for_small_names -v
(...)
0:00:07 load avg: 8.01 [ 36/1] test_traceback failed (1 failure)
test_import_from_error_bad_suggestions_do_not_trigger_for_small_names (test.test_traceback.CPythonSuggestionFormattingTests.test_import_from_error_bad_suggestions_do_not_trigger_for_small_names) ...
test_import_from_error_bad_suggestions_do_not_trigger_for_small_names (test.test_traceback.CPythonSuggestionFormattingTests.test_import_from_error_bad_suggestions_do_not_trigger_for_small_names) (name='py') ... FAIL
test_import_from_error_bad_suggestions_do_not_trigger_for_small_names (test.test_traceback.PurePythonSuggestionFormattingTests.test_import_from_error_bad_suggestions_do_not_trigger_for_small_names) ... ok
======================================================================
FAIL: test_import_from_error_bad_suggestions_do_not_trigger_for_small_names (test.test_traceback.CPythonSuggestionFormattingTests.test_import_from_error_bad_suggestions_do_not_trigger_for_small_names) (name='py')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vstinner/python/main/Lib/test/test_traceback.py", line 3172, in test_import_from_error_bad_suggestions_do_not_trigger_for_small_names
self.assertNotIn("vvv", actual)
AssertionError: 'vvv' unexpectedly found in "ImportError: cannot import name 'py' from 'NkosMVLvvvpdqPze' (/tmp/test_python_xfxl02nj/tmp7l231ock/NkosMVLvvvpdqPze.py)"
$ git show
commit 5612e561a96f4da735e966f527e1e01265564ae1 (HEAD -> pr/99895)
Author: Pablo Galindo <[email protected]>
Date: Wed Nov 30 11:22:49 2022 +0000
gh-99894: Ensure the local names don't collide with the test file in traceback suggestion error checking
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Ah, this PR changes test_getattr_error_bad_suggestions_do_not_trigger_for_small_names(), but not test_import_from_error_bad_suggestions_do_not_trigger_for_small_names().
You should also change test_import_from_error_bad_suggestions_do_not_trigger_for_small_names(), no?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…test file in traceback suggestion error checking
Ah, this PR changes test_getattr_error_bad_suggestions_do_not_trigger_for_small_names(), but not test_import_from_error_bad_suggestions_do_not_trigger_for_small_names().
You should also change test_import_from_error_bad_suggestions_do_not_trigger_for_small_names(), no?
Done!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I ran ./python -m test test_traceback -j20 -F -m test_import_from_error_bad_suggestions_do_not_trigger_for_small_names -v for 9 min 24 sec: 3669 tests OK.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Another test: ./python -m test test_traceback -j20 -F -v ran for 4 min 50 sec: 52 tests OK.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Another test: ./python -m test test_traceback -j20 -F -m test_getattr_error_bad_suggestions_do_not_trigger_for_small_names -v ran for 9 min 28 sec: 5086 tests OK.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM: I tested functionnaly the change, it does fix #99894
I have a minor suggestion.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
@@ -2979,8 +2979,8 @@ class MyClass: |
|
|
with self.subTest(name=name):
|
|
|
actual = self.get_suggestion(MyClass, name)
|
|
|
self.assertNotIn("you mean", actual)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe check for Did you mean? Same remark for the other test.
Other test_traceback tests check for this (a little bit longer) pattern.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
test_threading of "Address sanitizer" failed (env changed). I re-ran this CI job.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Python 3.10 and 3.11 are not affected.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot ARM Raspbian 3.x has failed when building commit 0563be2.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/424/builds/3060) and take a look at the build logs.
- Check if the failure is related to this commit (0563be2) or if it is a false positive.
- If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.
You can take a look at the buildbot page here:
https://buildbot.python.org/all/#builders/424/builds/3060
Summary of the results of the build (if available):
== Tests result: ENV CHANGED ==
411 tests OK.
10 slowest tests:
- test_venv: 12 min 28 sec
- test_largefile: 8 min 51 sec
- test_lib2to3: 6 min 28 sec
- test_multiprocessing_spawn: 4 min 2 sec
- test_concurrent_futures: 3 min 19 sec
- test_asyncio: 3 min
- test_tokenize: 2 min 5 sec
- test_multiprocessing_forkserver: 1 min 56 sec
- test_gdb: 1 min 42 sec
- test_cppext: 1 min 39 sec
1 test altered the execution environment:
test_concurrent_futures
21 tests skipped:
test_check_c_globals test_devpoll test_idle test_ioctl test_kqueue
test_launcher test_msilib test_peg_generator test_perf_profiler
test_startfile test_tcl test_tix test_tkinter test_ttk
test_ttk_textonly test_turtle test_winconsoleio test_winreg
test_winsound test_wmi test_zipfile64
Total duration: 29 min 44 sec
Click to see traceback logs
remote: Enumerating objects: 9, done.
remote: Counting objects: 11% (1/9)
remote: Counting objects: 22% (2/9)
remote: Counting objects: 33% (3/9)
remote: Counting objects: 44% (4/9)
remote: Counting objects: 55% (5/9)
remote: Counting objects: 66% (6/9)
remote: Counting objects: 77% (7/9)
remote: Counting objects: 88% (8/9)
remote: Counting objects: 100% (9/9)
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 20% (1/5)
remote: Compressing objects: 40% (2/5)
remote: Compressing objects: 60% (3/5)
remote: Compressing objects: 80% (4/5)
remote: Compressing objects: 100% (5/5)
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 4), reused 0 (delta 0), pack-reused 0
From https://github.com/python/cpython
* branch main -> FETCH_HEAD
Note: switching to '0563be23a557917228a8b48cbb31bda285a3a815'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 0563be23a5 gh-99894: Ensure the local names don't collide with the test file in traceback suggestion error checking (#99895)
Switched to and reset branch 'main'
Objects/obmalloc.c:776:1: warning: ‘always_inline’ function might not be inlinable [-Wattributes]
776 | arena_map_get(pymem_block *p, int create)
| ^~~~~~~~~~~~~
make: *** [Makefile:1889: buildbottest] Error 3
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
carljm
added a commit
to carljm/cpython
that referenced
this pull request
Dec 1, 2022
|
|
self.assertNotIn("vvv", actual)
|
|
|
self.assertNotIn("mom", actual)
|
|
|
self.assertNotIn("Did you mean", actual)
|
|
|
self.assertNotIn("'vvv", actual)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this has any effect but there is a ' missing here
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
vstinner
vstinner approved these changes
+1 more reviewer
kadiwa4
kadiwa4 left review comments
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|