cpython: 0207c6203f84 (original) (raw)
Mercurial > cpython
changeset 101677:0207c6203f84 3.5
Issue #27196: Stop 'application destroyed' warnings when running IDLE tests. The update_idletasks solution was provided by Serhiy Storchaka. [#27196]
Terry Jan Reedy tjreedy@udel.edu | |
---|---|
date | Fri, 03 Jun 2016 23:53:56 -0400 |
parents | 813bb6a4c693 |
children | 2d864ac472f0 2e0eec77028e 566cbc844574 |
files | Lib/idlelib/idle_test/README.txt Lib/idlelib/idle_test/test_configdialog.py Lib/idlelib/idle_test/test_parenmatch.py Lib/idlelib/idle_test/test_textview.py Lib/idlelib/idle_test/test_widgetredir.py |
diffstat | 5 files changed, 22 insertions(+), 10 deletions(-)[+] [-] Lib/idlelib/idle_test/README.txt 6 Lib/idlelib/idle_test/test_configdialog.py 9 Lib/idlelib/idle_test/test_parenmatch.py 9 Lib/idlelib/idle_test/test_textview.py 3 Lib/idlelib/idle_test/test_widgetredir.py 5 |
line wrap: on
line diff
--- a/Lib/idlelib/idle_test/README.txt +++ b/Lib/idlelib/idle_test/README.txt @@ -71,9 +71,15 @@ deleted BEFORE root is destroyed. See h @classmethod def tearDownClass(cls): del cls.text
cls.root.update_idletasks()[](#l1.7) cls.root.destroy()[](#l1.8) del cls.root[](#l1.9)
+The update_idletasks call is sometimes needed to prevent the following warning +either when running a test alone or as part of the test suite (#27196).
- can't invoke "event" command: application has been destroyed
- ...
- "ttk::ThemeChanged" Requires('gui') causes the test(s) it guards to be skipped if any of these conditions are met:
--- a/Lib/idlelib/idle_test/test_configdialog.py +++ b/Lib/idlelib/idle_test/test_configdialog.py @@ -1,7 +1,7 @@ -'''Unittests for idlelib/configHandler.py +'''Test idlelib.configHandler. -Coverage: 46% just by creating dialog. The other half is change code. - +Coverage: 46% just by creating dialog. +The other half is code for working with user customizations. ''' import unittest from test.support import requires @@ -20,11 +20,12 @@ class ConfigDialogTest(unittest.TestCase @classmethod def tearDownClass(cls):
cls.root.update_idletasks()[](#l2.18) cls.root.destroy()[](#l2.19) del cls.root[](#l2.20)
d=ConfigDialog(self.root, 'Test', _utest=True)[](#l2.23)
d = ConfigDialog(self.root, 'Test', _utest=True)[](#l2.24) d.remove_var_callbacks()[](#l2.25) d.destroy()[](#l2.26)
--- a/Lib/idlelib/idle_test/test_parenmatch.py +++ b/Lib/idlelib/idle_test/test_parenmatch.py @@ -1,6 +1,8 @@ -"""Test idlelib.ParenMatch.""" -# This must currently be a gui test because ParenMatch methods use -# several text methods not defined on idlelib.idle_test.mock_tk.Text. +'''Test idlelib.ParenMatch. + +This must currently be a gui test because ParenMatch methods use +several text methods not defined on idlelib.idle_test.mock_tk.Text. +''' from test.support import requires requires('gui') @@ -29,6 +31,7 @@ class ParenMatchTest(unittest.TestCase): @classmethod def tearDownClass(cls): del cls.text, cls.editwin
cls.root.update_idletasks()[](#l3.19) cls.root.destroy()[](#l3.20) del cls.root[](#l3.21)
--- a/Lib/idlelib/idle_test/test_textview.py +++ b/Lib/idlelib/idle_test/test_textview.py @@ -1,4 +1,4 @@ -'''Test the functions and main class method of textView.py. +'''Test idlelib.textView. Since all methods and functions create (or destroy) a TextViewer, which is a widget containing multiple widgets, all tests must be gui tests. @@ -24,6 +24,7 @@ def setUpModule(): def tearDownModule(): global root, TV del TV
--- a/Lib/idlelib/idle_test/test_widgetredir.py +++ b/Lib/idlelib/idle_test/test_widgetredir.py @@ -1,7 +1,7 @@ -"""Unittest for idlelib.WidgetRedirector +'''Test idlelib.WidgetRedirector. 100% coverage -""" +''' from test.support import requires import unittest from idlelib.idle_test.mock_idle import Func @@ -49,6 +49,7 @@ class WidgetRedirectorTest(unittest.Test @classmethod def tearDownClass(cls): del cls.text
cls.root.update_idletasks()[](#l5.17) cls.root.destroy()[](#l5.18) del cls.root[](#l5.19)