bpo-33855: Minimally test all IDLE modules.#7689
Conversation
willingc
left a comment
There was a problem hiding this comment.
Thanks @terryjreedy. I noticed one possible typo. LGTM.
Lib/idlelib/idle_test/template.py
Outdated
| from test.support import requires | ||
| from tkinter import Tk | ||
|
|
||
| import |
There was a problem hiding this comment.
I don't see a misspelling. The name of the tested module goes after Test above and after import. I can see how this might not be clear if you did not write it ;-). But all idlelib module imports need from idlelib prefixed, so I added that.
There was a problem hiding this comment.
So let me make sure that I understand, you have import as a placeholder for someone writing a test for a module (say "xyz"). Folks would copy the template, change the file's name to test_xyz.py. Inside the file a person writing tests would insert xyz as:
Test xyz coverage %.
...
import xyz
Just clarifying that an import statement without a module name isn't planned to be executed. (If I'm missing the boat, and you can execute import without a . or module name, please let me know since I didn't think one could do this).
There was a problem hiding this comment.
Perhaps it would be clearer to name the file test_modname.py.template, and insert modname where the module name should go rather than leaving blanks. From a UNIX perspective, this would allow one to do sed 's/modname/real_mod_name/g' test_modname.py.template > test_real_mod_name.py to create the test file from the template in one step.
There was a problem hiding this comment.
Windows does not have sed, and for two insertions, it is not worth the trouble. The name 'template.py' puts the file just above the first test_a.py file, making it initially visible in IDLE's open dialog and easy to find, and automatically 'saved as' a .py file.
I am the initial user of the file, for this issue. It standardizes the header and footer lines and documents some of the setup and teardown needed for gui tests. (I just discovered and added a new trick for EditorWindow.) I intend to discuss it, along with other gui-testing tricks not part of the template, in the README.
Prevent tcl event warning on shutdown
Create a template for minimally testing a tkinter-using module by importing it and instantiating its class(es). Add a test file for all non-startup IDLE modules. Edit existing files and update coverage. This is part 1 of 3, covering the 21 autocomplete to help modules and touching 33 idlelib files. (cherry picked from commit ee5ef30) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
GH-7731 is a backport of this pull request to the 3.7 branch. |
|
Sorry, @terryjreedy, I could not cleanly backport this to |
Create a template for minimally testing a tkinter-using module by importing it and instantiating its class(es). Add a test file for all non-startup IDLE modules. Edit existing files and update coverage. This is part 1 of 3, covering the 21 autocomplete to help modules and touching 33 idlelib files. (cherry picked from commit ee5ef30) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Create a template for minimally testing a tkinter-using module by importing it and instantiating its class(es). Add a test file for all non-startup IDLE modules. Edit existing files and update coverage. This is part 1 of 3, covering the 21 autocomplete to help modules and touching 33 idlelib files.. (cherry picked from commit ee5ef30) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
GH-7734 is a backport of this pull request to the 3.6 branch. |
Create a template for minimally testing a tkinter-using module by importing it and instantiating its class(es). Add a test file for all non-startup IDLE modules. Edit existing files and update coverage. This is part 1 of 3, covering the 21 autocomplete to help modules and touching 33 idlelib files.. (cherry picked from commit ee5ef30) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Part 2 of 3. Continues PR pythonGH-7689, changeset ee5ef30. Edit and add tests for 18 modules, help_about to replace and run. (cherry picked from commit ea3dc80) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Part 2 of 3. Continues PR pythonGH-7689, changeset ee5ef30. Edit and add tests for 18 modules, help_about to replace and run. (cherry picked from commit ea3dc80) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Part 3 of 3, continuing PR pythonGH-7689. This covers 14 idlelib modules and their tests, rpc to zoomheight except for run (already done) and tooltip (being done separately). (cherry picked from commit 4d92158) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Part 3 of 3, continuing PR pythonGH-7689. This covers 14 idlelib modules and their tests, rpc to zoomheight except for run (already done) and tooltip (being done separately). (cherry picked from commit 4d92158) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Create a template for minimally testing a tkinter-using module by importing it and instantiating its class(es). Add a test file for all non-startup IDLE modules. Edit existing files and update coverage. This is part 1 of 3, covering the 21 autocomplete to help modules and touching 33 idlelib files. (cherry picked from commit ee5ef30) # Conflicts fixed: # Lib/idlelib/idle_test/test_calltip.py
https://bugs.python.org/issue33855