Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f74805b2
Commit
f74805b2
authored
Jun 01, 2014
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #21477: Update htest docstring and remove extraneous differences between
2.7 and 3.4. Original patch by Saimadhav Heblikar.
parent
e047f56b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
Lib/idlelib/idle_test/htest.py
Lib/idlelib/idle_test/htest.py
+17
-9
No files found.
Lib/idlelib/idle_test/htest.py
View file @
f74805b2
'''Run human tests of Idle's window, dialog, and popup widgets.
run(test): run *test*, a callable that causes a widget to be displayed.
runall(): run all tests defined in this file.
run(*tests)
Run each callable in tests after finding the matching test spec in this file.
If there are none, run an htest for each spec dict in this file after finding
the matching callable in the module named in the spec.
Let X be a global name bound to a widget callable. End the module with
In a tested module, let X be a global name bound to a widget callable.
End the module with
if __name__ == '__main__':
<unittest, if there is one>
...
...
@@ -13,9 +16,9 @@ if __name__ == '__main__':
The X object must have a .__name__ attribute and a 'parent' parameter.
X will often be a widget class, but a callable instance with .__name__
or a wrapper function also work. The name of wrapper functions, like
'_editor_
W
indow', should start with '_'.
'_editor_
w
indow', should start with '_'.
This file must contain a matching instance of the folling template,
This file must contain a matching instance of the foll
ow
ing template,
with X.__name__ prepended, as in '_editor_window_spec ...'.
_spec = {
...
...
@@ -24,11 +27,17 @@ _spec = {
'msg': ""
}
file (no .py): used in run
all
() to import the file and get X.
file (no .py): used in run() to import the file and get X.
kwds: passed to X (**kwds), after 'parent' is added, to initialize X.
title: an example; used for some widgets, delete if not.
msg: displayed in a master window. Hints as to how the user might
test the widget. Close the window to skip or end the test.
Modules not being tested at the moment:
PyShell.PyShellEditorWindow
Debugger.Debugger
AutoCompleteWindow.AutoCompleteWindow
OutputWindow.OutputWindow (indirectly being tested with grep test)
'''
from
importlib
import
import_module
from
idlelib.macosxSupport
import
_initializeTkVariantTests
...
...
@@ -94,7 +103,7 @@ _dyn_option_menu_spec = {
_editor_window_spec
=
{
'file'
:
'EditorWindow'
,
'kwds'
:
{},
'msg'
:
"Test editor functions of interest"
'msg'
:
"Test editor functions of interest
.
"
}
GetCfgSectionNameDialog_spec
=
{
...
...
@@ -305,7 +314,6 @@ def run(*tests):
scrollbar
.
pack
(
side
=
'right'
,
fill
=
'y'
,
expand
=
False
)
text
.
pack
(
side
=
'left'
,
fill
=
'both'
,
expand
=
True
)
test_list
=
[]
# List of tuples of the form (spec, callable widget)
if
tests
:
for
test
in
tests
:
...
...
@@ -333,7 +341,7 @@ def run(*tests):
test_spec
,
callable_object
[
0
]
=
test_list
.
pop
()
test_kwds
[
0
]
=
test_spec
[
'kwds'
]
test_kwds
[
0
][
'parent'
]
=
root
test_name
[
0
].
set
(
'
t
est '
+
test_spec
[
'name'
])
test_name
[
0
].
set
(
'
T
est '
+
test_spec
[
'name'
])
text
.
configure
(
state
=
'normal'
)
# enable text editing
text
.
delete
(
'1.0'
,
'end'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment