You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix and document idlelib/idle_test/template.py #78098
Seen with the 3.6 branch and the 3.7 branch at least. This file is installed by default, so should be valid syntax? If it's supposed to be that way, maybe call the template like template.py.in?
Unpacking libpython3.6-testsuite (3.6.6~rc1-3) ...
Setting up libpython3.6-testsuite (3.6.6~rc1-3) ...
File "/usr/lib/python3.6/idlelib/idle_test/template.py", line 3
from idlelib import
^
SyntaxError: invalid syntax
I wrote it intentionally the way it is, for bpo-33855, as it made it maximally easily to use to complete the test suite. Since it caused a problem, I added a valid dummy name to be replaced, and fixed the other syntax error. The file now compiles, runs, and tests OK. New IDLE modules needing a new test file should be rare.
I will submit the PR after I edit the readme to document the usage of the template.
Tal and Cheryl: I revised the template for IDLE tests, pulled it out of README.txt into template.py, and explained it in the readme. It has new code for cleaning up after instantiating EditorWindow in tests. Please follow for any new test file, including test_tooltip and test_squeezer. (They should both be pretty close already.)
FTR, the problem change was merged/backported after 3.7.0rc1 and 3.6.6rc1 so doko must have been working from a development branch and not a release tag. The original and its fix will first be officially released in 3.7.1 and 3.6.7 so there's really no need for a correction NEWS entry; it doesn't hurt either.
Activity
doko42 commentedon Jun 20, 2018
Seen with the 3.6 branch and the 3.7 branch at least. This file is installed by default, so should be valid syntax? If it's supposed to be that way, maybe call the template like template.py.in?
Unpacking libpython3.6-testsuite (3.6.6~rc1-3) ...
Setting up libpython3.6-testsuite (3.6.6~rc1-3) ...
File "/usr/lib/python3.6/idlelib/idle_test/template.py", line 3
from idlelib import
^
SyntaxError: invalid syntax
terryjreedy commentedon Jun 20, 2018
I wrote it intentionally the way it is, for bpo-33855, as it made it maximally easily to use to complete the test suite. Since it caused a problem, I added a valid dummy name to be replaced, and fixed the other syntax error. The file now compiles, runs, and tests OK. New IDLE modules needing a new test file should be rare.
I will submit the PR after I edit the readme to document the usage of the template.
[-]idlelib/idle_test/template.py has invalid syntax[/-][+]Fix and document idlelib/idle_test/template.py[/+]terryjreedy commentedon Jun 20, 2018
Tal and Cheryl: I revised the template for IDLE tests, pulled it out of README.txt into template.py, and explained it in the readme. It has new code for cleaning up after instantiating EditorWindow in tests. Please follow for any new test file, including test_tooltip and test_squeezer. (They should both be pretty close already.)
terryjreedy commentedon Jun 20, 2018
New changeset 87a9273 by Terry Jan Reedy in branch 'master':
bpo-33917: Fix and document idlelib/idle_test/template.py (GH-7830)
87a9273
miss-islington commentedon Jun 20, 2018
New changeset a717c56 by Miss Islington (bot) in branch '3.7':
bpo-33917: Fix and document idlelib/idle_test/template.py (GH-7830)
a717c56
miss-islington commentedon Jun 20, 2018
New changeset 7c853d0 by Miss Islington (bot) in branch '3.6':
bpo-33917: Fix and document idlelib/idle_test/template.py (GH-7830)
7c853d0
ned-deily commentedon Jun 27, 2018
FTR, the problem change was merged/backported after 3.7.0rc1 and 3.6.6rc1 so doko must have been working from a development branch and not a release tag. The original and its fix will first be officially released in 3.7.1 and 3.6.7 so there's really no need for a correction NEWS entry; it doesn't hurt either.