GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-33855: Minimally test all IDLE modules. by terryjreedy · Pull Request #7689 · python/cpython

Conversation

@terryjreedy

@terryjreedy terryjreedy commented Jun 14, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
for implementation module in idlelib modules:
    if test_module not in idle_test:
        create test_module from template.py;   add 'module' to docstring
        import module and check other minimal imports
        create instance of each class, with requires('gui') if needed
        add initial coverage of this test
        add test invocation to module
    else:
        check same for existing test     

https://bugs.python.org/issue33855

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
terryjreedy added 7 commits June 13, 2018 23:17
@terryjreedy
Edit test_autocomplete.
0d3dcc1
@terryjreedy
Edit test_autocomplete.
f819957
@terryjreedy
Add test_autocomplete_w.
a661e32
@terryjreedy
Edit autocomplete_w.py.
858d9d4
@terryjreedy
Edit test_calltips.
b011fd3
@terryjreedy
Add idle_test/template.py.
3f4e9cf
@terryjreedy
Edit test_autoexpand.
4572cde
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jun 14, 2018
@bedevere-bot bedevere-bot added the awaiting merge label Jun 14, 2018
@terryjreedy terryjreedy changed the title bpo-33855: Minimally test all IDLE files. bpo-33855: Minimally test all IDLE modules. Jun 14, 2018
@terryjreedy terryjreedy added needs backport to 3.6 tests Tests in the Lib/test dir labels Jun 14, 2018
@terryjreedy terryjreedy self-assigned this Jun 14, 2018
willingc
willingc reviewed Jun 14, 2018
View reviewed changes

@willingc willingc left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @terryjreedy. I noticed one possible typo. LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/idlelib/idle_test/template.py Outdated
from test.support import requires
from tkinter import Tk

import

@willingc willingc Jun 14, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@terryjreedy terryjreedy Jun 14, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@willingc willingc Jun 14, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@zware zware Jun 14, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@terryjreedy terryjreedy Jun 15, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
terryjreedy added 15 commits June 14, 2018 11:36
@terryjreedy
Add blurb.
c19d810
@terryjreedy
Edit test_browser.
dedc726
@terryjreedy
Edit template.
8658eab
@terryjreedy
Edit template.
59b504b
@terryjreedy
Edit template.
23375c7
@terryjreedy
Add test_calltip_w.py.
3d23f61
@terryjreedy
Edit tests for codecontext, colorizer, config, and config_key.
c0328ce
@terryjreedy
Edit test_calltips.
d764c73
@terryjreedy
Move tested module import first.
9248976
@terryjreedy
Edit template and test_autocomple_w.
ce7c113
Prevent tcl event warning on shutdown
@terryjreedy
templage whitespace
bc81598
@terryjreedy
Edit test_configdialog and test_debugger.
ad6232f
@terryjreedy
Edit autocomplete, autocomplete_w, calltip_w, colorizer.
e3b77a1
@terryjreedy
Add test_debugger_r, edit test_debugger, debugger, debugger_r.
126d2d0
@terryjreedy
Edit debugobj, debugobj_r, add test_debugobj, test_debugobj_r.
5a81d36
@terryjreedy
terryjreedy deleted the moretests branch June 15, 2018 22:21
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 15, 2018
@terryjreedy @miss-islington
bpo-33855: Minimally test all IDLE modules. (pythonGH-7689)
fe09f36
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 <[email protected]>
@bedevere-bot

bedevere-bot commented Jun 15, 2018

Copy link
Copy Markdown

GH-7731 is a backport of this pull request to the 3.7 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.7 label Jun 15, 2018
@miss-islington

miss-islington commented Jun 15, 2018

Copy link
Copy Markdown
Contributor

Sorry, @terryjreedy, I could not cleanly backport this to 3.6 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker ee5ef309c7e2daef1248730145408f700732c42e 3.6

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington added a commit that referenced this pull request Jun 15, 2018
@miss-islington @terryjreedy
bpo-33855: Minimally test all IDLE modules. (GH-7689)
5085687
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 <[email protected]>
terryjreedy added a commit to terryjreedy/cpython that referenced this pull request Jun 15, 2018
@terryjreedy
[3.6] bpo-33855: Minimally test all IDLE modules. (pythonGH-7689)
4675e81
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 <[email protected]>
@bedevere-bot

bedevere-bot commented Jun 15, 2018

Copy link
Copy Markdown

GH-7734 is a backport of this pull request to the 3.6 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.6 label Jun 15, 2018
terryjreedy added a commit that referenced this pull request Jun 16, 2018
@terryjreedy
[3.6] bpo-33855: Minimally test all IDLE modules. (GH-7689) (GH-7734)
833b3d2
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 <[email protected]>
@terryjreedy terryjreedy mentioned this pull request Jun 17, 2018
bpo-33855: More edits and new minimal tests for IDLE #7761
Merged
@miss-islington miss-islington mentioned this pull request Jun 18, 2018
[3.7] bpo-33855: More edits and new minimal tests for IDLE (GH-7761) #7774
Merged
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 18, 2018
@terryjreedy @miss-islington
bpo-33855: More edits and new minimal tests for IDLE (pythonGH-7761)
d34d461
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 <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 18, 2018
@terryjreedy @miss-islington
bpo-33855: More edits and new minimal tests for IDLE (pythonGH-7761)
4b14bce
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 <[email protected]>
@miss-islington miss-islington mentioned this pull request Jun 18, 2018
[3.6] bpo-33855: More edits and new minimal tests for IDLE (GH-7761) #7775
Merged
terryjreedy added a commit that referenced this pull request Jun 18, 2018
@terryjreedy
bpo-33855: More edits and new minimal tests for IDLE (GH-7761)
ea3dc80
Part 2 of 3.  Continues PR #7689, changeset ee5ef30.
Edit and add tests for 18 modules, help_about to replace and run.
miss-islington added a commit that referenced this pull request Jun 18, 2018
@miss-islington @terryjreedy
bpo-33855: More edits and new minimal tests for IDLE (GH-7761)
740f1cb
Part 2 of 3.  Continues PR GH-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 <[email protected]>
miss-islington added a commit that referenced this pull request Jun 18, 2018
@miss-islington @terryjreedy
bpo-33855: More edits and new minimal tests for IDLE (GH-7761)
684bc3d
Part 2 of 3.  Continues PR GH-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 <[email protected]>
@terryjreedy terryjreedy mentioned this pull request Jun 19, 2018
bpo-33855: Still more edits and minimal tests for IDLE #7784
Merged
@miss-islington miss-islington mentioned this pull request Jun 19, 2018
[3.7] bpo-33855: Still more edits and minimal tests for IDLE (GH-7784) #7805
Merged
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 19, 2018
@terryjreedy @miss-islington
bpo-33855: Still more edits and minimal tests for IDLE (pythonGH-7784)
8e7fd11
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 <[email protected]>
@miss-islington miss-islington mentioned this pull request Jun 19, 2018
[3.6] bpo-33855: Still more edits and minimal tests for IDLE (GH-7784) #7806
Merged
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 19, 2018
@terryjreedy @miss-islington
bpo-33855: Still more edits and minimal tests for IDLE (pythonGH-7784)
736cb6f
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 <[email protected]>
terryjreedy added a commit that referenced this pull request Jun 19, 2018
@terryjreedy
bpo-33855: Still more edits and minimal tests for IDLE (GH-7784)
4d92158
Part 3 of 3, continuing PR #7689. This covers 14 idlelib modules and their tests,
rpc to zoomheight except for run (already done) and tooltip (being done separately).
miss-islington added a commit that referenced this pull request Jun 20, 2018
@miss-islington @terryjreedy
bpo-33855: Still more edits and minimal tests for IDLE (GH-7784)
cbaee6f
Part 3 of 3, continuing PR GH-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 <[email protected]>
miss-islington added a commit that referenced this pull request Jun 20, 2018
@miss-islington @terryjreedy
bpo-33855: Still more edits and minimal tests for IDLE (GH-7784)
90209a1
Part 3 of 3, continuing PR GH-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 <[email protected]>
terryjreedy added a commit to terryjreedy/cpython that referenced this pull request Jun 20, 2018
@terryjreedy
bpo-33855: Minimally test all IDLE modules. (pythonGH-7689)
c63dbcb
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@willingc willingc willingc left review comments
@zware zware zware left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@terryjreedy terryjreedy

Labels

tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@terryjreedy @miss-islington @bedevere-bot @willingc @zware @the-knights-who-say-ni
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.