-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Improve test coverage for idlelib #79849
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
Comments
idlelib is one of the lesser-tested libraries in cpython: Raising this issue and also volunteering to extend the test module to get coverage across major behaviours and functions that are missing tests. |
I (we) agree that idlelib needs even better test coverage. Some history:
Some modules need doctests and a bit of refactoring before adding tests. Tests for a specific module should be a separate issue. Testing tkinter is hard. Can you tell us a bit about your python, tkinter, and testing experience? Cheryl Sabella wrote the majority of tests added in the last year+, and Tal Einat wrote test_squeezer. I suggest you review some of their recent work. They should be able to answer most questions as well as me. |
thanks terry, Some great pointers there, I'll review the exiting work and the README doc. With regards to my experience, I have quite extensive experience with python testing. Most of which would be open-source on my Github profile https://github.com/tonybaloney I admit I don't have much experience with tkinter. It does sound like a challenge, but definitely one that I'm willing to research and approach responsibly. |
Great. I suggest then that you start with untested, normal, non-GUI (non-tkinter) code, assuming that you can find some. This can mean segregating functional code from gui code if they are currently intertwined. As point 1 above suggested, IDLE, which dates from about 2000, was originally written without automated testing in mind. I should have added above Such code still needs 'does the right thing' tests. Part of my intention was to make adding those easier by removing the initial boilerplate as a barrier. |
I was looking at the debugger.py module as being a good place the start, writing test cases for the Idb, Debugger, StackViewer and NamespaceViewer by patching out the dependant components (bdb, Idb, etc. I might start there, raise a PR against it and do a module at a time, then work my way up to some of the trickier, tkinter-based modules. |
I like that choice. There are 15 open issues for debugger and I have notes on a few possible enhancements. |
Welcome Anthony! Please ask me any questions you may have. My only suggestion at this point would be for you to feel free to add any docstrings/comments to the module as you go. Having the docstrings really helps in understanding the tests and vice versa. |
thanks Cheryl, here's my branch https://github.com/tonybaloney/cpython/tree/idlelib_tests I've already seen some code which is 17 years old! |
I like having multiple commits with explanatory messages. They get squashed when merging into master. Unless I get distracted and forget, I will squash the messages. |
I moved the debugger tests to bpo-35690. I want to keep this issue for general discussion of testing IDLE, and possibly related PRs improving the documentation thereof. Serhiy Storchaka, the current tkinter maintainer, and I, have decided that IDLE should run with the implicit default root mechanism disabled. (It allows bugs unless there are no explicit Tk() calls in the process.) Therefore, tests should run the same way. But when I put 'tk.NoDefaultRoot()' in the always-run part of test.test_idle, which is usually run with test.regrtest, there were problems. So I moved it to the 'if main' clause that runs the IDLE suite directly with unittest. But this clause only executes when test_idle is the main module, such as when one runs 'python -m test.test_idle' instead of 'python -m test -ugui', with or without 'test_idle added to restrict testing to test_idle. I will add the consequence for the debugger test to the PR. |
With the movement of issues to github, we have IDLE Issues with 'Tests' and 'Test module' sections. |
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: