-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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: make autocomplete test run without __main__.__file__ #84900
Comments
import test.test_idle as ti
import unittest as u
u.main(ti) has one failure:
Traceback (most recent call last):
File "C:\Programs\Python39\lib\idlelib\idle_test\test_autocomplete.py", line 230, in test_fetch_completions
if __main__.__file__ != ac.__file__:
AttributeError: module '__main__' has no attribute '__file__' ac = autocomplete. The condition is followed by
self.assertNotIn('AutoComplete', small) # See issue 36405 which is false when ac is run as main to run the test. Adding "hasattr(main, '__file__') and " to the beginning of the condition should be sufficient. I should add a note to bpo-36405 explaining this conditional assertion better. |
This is currently the only occurrence of __main__.__file__ in idlelib. |
I was able to reproduce the reported issue and the suggested fix worked fine. Is there anything else missing like documentation note? I would like to submit a PR for this @terry.reedy |
Go ahead. Since the failure was user visible, there should be a note. For IDLE issues, idlelib/NEWS.txt also needs an addition, but not until ready to merge. So add a trial blurb or not as you wish. In any case, I need to fix the 3.8 version and perhaps the 3.7 version before another IDLE commit. |
I added a news entry to idlelib/NEWS.txt but don't know, where to add an additional note. The documentation of IDLE doesn't seem to be the right place. Should a note be added to Misc/NEWS.d/next or would it be redundant, because it is already added to idlelib/NEWS.txt? Sorry, if I misunderstood you, but it is my first contribution to IDLE. Thanks for the guidance, I really appreciate it! |
Are there further work to be done here, or can we close this? |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: