diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2016-06-04 02:19:17 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2016-06-04 02:19:17 (GMT) |
commit | 75cbeb5dac8f4f57777f053eee257dbba5553d98 (patch) | |
tree | 9d3a48f3a70cb987e3801a110f8d5084f2bcac3b /Lib/idlelib/idle_test/README.txt | |
parent | 1ef8c7e886ea5260e5a6967ec2b8a4c32640f1a8 (diff) | |
download | cpython-75cbeb5dac8f4f57777f053eee257dbba5553d98.zip cpython-75cbeb5dac8f4f57777f053eee257dbba5553d98.tar.gz cpython-75cbeb5dac8f4f57777f053eee257dbba5553d98.tar.bz2 |
Issue 20567: Revise idle_test/README.txt and some tests to match new advice.
Diffstat (limited to 'Lib/idlelib/idle_test/README.txt')
-rw-r--r-- | Lib/idlelib/idle_test/README.txt | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/Lib/idlelib/idle_test/README.txt b/Lib/idlelib/idle_test/README.txt index f74affc..39a19d0 100644 --- a/Lib/idlelib/idle_test/README.txt +++ b/Lib/idlelib/idle_test/README.txt @@ -56,40 +56,44 @@ requires('gui') To guard a test class, put "requires('gui')" in its setUpClass function. -To avoid interfering with other GUI tests, all GUI objects must be -destroyed and deleted by the end of the test. Widgets, such as a Tk -root, created in a setUpX function, should be destroyed in the -corresponding tearDownX. Module and class widget attributes should also -be deleted. +To avoid interfering with other gui tests, all gui objects must be destroyed and +deleted by the end of the test. The Tk root created in a setUpX function should +be destroyed in the corresponding tearDownX and the module or class attribute +deleted. Others widgets should descend from the single root and the attributes +deleted BEFORE root is destroyed. See https://bugs.python.org/issue20567. @classmethod def setUpClass(cls): requires('gui') cls.root = tk.Tk() + cls.text = tk.Text(root) @classmethod def tearDownClass(cls): + del cls.text cls.root.destroy() del cls.root Requires('gui') causes the test(s) it guards to be skipped if any of -a few conditions are met: - +these conditions are met: + - The tests are being run by regrtest.py, and it was started without enabling the "gui" resource with the "-u" command line option. - + - The tests are being run on Windows by a service that is not allowed to interact with the graphical environment. - + + - The tests are being run on Linux and X Windows is not available. + - The tests are being run on Mac OSX in a process that cannot make a window manager connection. - + - tkinter.Tk cannot be successfully instantiated for some reason. - + - test.support.use_resources has been set by something other than regrtest.py and does not contain "gui". - + Tests of non-GUI operations should avoid creating tk widgets. Incidental uses of tk variables and messageboxes can be replaced by the mock classes in idle_test/mock_tk.py. The mock text handles some uses of the |