[Python-checkins] cpython (merge 3.3 -> default): Merge with 3.3
terry.reedy
python-checkins at python.org
Sun Jul 28 22:41:15 CEST 2013
http://hg.python.org/cpython/rev/4d08db5edbaa
changeset: 84892:4d08db5edbaa
parent: 84890:f8c0062aa12c
parent: 84891:70a4287a25b4
user: Terry Jan Reedy <tjreedy at udel.edu>
date: Sun Jul 28 16:40:07 2013 -0400
summary:
Merge with 3.3
files:
Lib/idlelib/idle_test/README.txt | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/Lib/idlelib/idle_test/README.txt b/Lib/idlelib/idle_test/README.txt
--- a/Lib/idlelib/idle_test/README.txt
+++ b/Lib/idlelib/idle_test/README.txt
@@ -40,13 +40,20 @@
idle class. For the benefit of buildbot machines that do not have a graphics
screen, gui tests must be 'guarded' by "requires('gui')" in a setUp
function or method. This will typically be setUpClass.
+
+All gui objects must be destroyed by the end of the test, perhaps in a tearDown
+function. Creating the Tk root directly in a setUp allows a reference to be saved
+so it can be properly destroyed in the corresponding tearDown.
---
@classmethod
def setUpClass(cls):
requires('gui')
+ cls.root = tk.Tk()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.root.destroy()
---
-All gui objects must be destroyed by the end of the test, perhaps in a tearDown
-function.
Support.requires('gui') returns true if it is either called in a main module
(which never happens on buildbots) or if use_resources contains 'gui'.
@@ -56,8 +63,9 @@
Since non-gui tests always run, but gui tests only sometimes, tests of non-gui
operations should best avoid needing a gui. Methods that make incidental use of
-tkinter variables and messageboxes can do this by using the mock classes in
-idle_test/mock_tk.py.
+tkinter (tk) variables and messageboxes can do this by using the mock classes in
+idle_test/mock_tk.py. There is also a mock text that will handle some uses of the
+tk Text widget.
3. Running Tests
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list