Repository navigation
Conversation
|
Well, for these tests, I will rely on @terryjreedy's decision. If he is fine with the overall approach, I can review the implementation. |
|
I am still opposed to the idea (see issue) but will review this to see if it satisfies my objections to the previous proposed implementation. |
|
@terryjreedy did you have a chance to look at it? :) |
terryjreedy
left a comment
There was a problem hiding this comment.
I want to make IDLE's tests as independent of location as sensibly possible, but not move them now. The comments are about what can/should go in a new PR to do the former.
This PR could be then simplified and retested before being closed until needed.
| if __name__ == '__main__': | ||
| from unittest import main | ||
| main('idlelib.idle_test.test_autocomplete', verbosity=2) | ||
| main('test.test_idle.test_autocomplete', verbosity=2) |
There was a problem hiding this comment.
I would add utestdir = 'test.test_idle to util.py and from idlelib.util import utestdir above each main line, which would then become main('test.test_idle.test_autocomplete', verbosity=2). I believe easy enough with sed.
There was a problem hiding this comment.
Actually, if tests were not installed, this would just crash, and prevent running any htest that follows. Running a file's unittest would have to be made conditional (or the exception caught). This if tests were moved, this should be encapsulated in a util function that would fail gracefully.
| def _color_delegator(parent): # htest # | ||
| from tkinter import Toplevel, Text | ||
| from idlelib.idle_test.test_colorizer import source | ||
| from test.test_idle.test_colorizer import source |
There was a problem hiding this comment.
This would introduce a bug if IDLE were installed and tests were not (which is normal on macOS) and this were run. My thought is to move the (illegal) sample code into a file in idle_test.
| import unittest | ||
| import os | ||
|
|
||
| from test import support |
There was a problem hiding this comment.
This and the next change are pure style preference, independent of this issue. I don't care either way.
| idle_dir = os.path.dirname(__file__) | ||
| else: | ||
| idle_dir = os.path.abspath(sys.path[0]) | ||
| idle_dir = os.path.abspath(os.path.dirname(idlelib.__file__)) |
There was a problem hiding this comment.
I believe all these test file changes make them independent of test file location. If so, they can be done now without moving the files. It would be easy to find out. Some of these look like improvements in any case. I would add a note to idle_test.README.txt that tests should not depend on being in idle_test.
|
When you're done making the requested changes, leave the comment: |
|
This PR is stale because it has been open for 30 days with no activity. |
This work is based on #94145
I've addressed the original feedback.
Done ✅
Done ✅
Among other comments:
gitshould handle the path change smoothly@terryjreedy please, share your feedback, so we can make this transition as convenient for you as possible :)