GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-95069: Move tests from `idlelib.idle_test` to `test.test_idle` by sobolevn · Pull Request #115444 · python/cpython 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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@terryjreedy did you have a chance to look at it? :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| 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.
The reason will be displayed to describe this comment to others. Learn more.
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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| 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.
The reason will be displayed to describe this comment to others. Learn more.
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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| import unittest | ||
| import os | ||
|
|
||
| from test import support |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This and the next change are pure style preference, independent of this issue. I don't care either way.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| 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.
The reason will be displayed to describe this comment to others. Learn more.
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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
When you're done making the requested changes, leave the comment: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR is blocked on its author, has not been touched by a human in more than 2 years, and no longer merges cleanly. Closing to cull the number of open pull requests. Do not reopen this pull request without getting a go-ahead from a triager or core developer on gh-95069. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.