summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-06-04 03:58:37 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2016-06-04 03:58:37 (GMT)
commit5a493e9dc4f83e7e2a67dc38b7d2b886a6ee8960 (patch)
tree6018bd4cc6d48c33a8fd9c3bcf679c0800565489 /Lib
parent3d7281d2bdf0bbea105d73a12555366f29d6830e (diff)
parent6047b5537226efdcd2e3b460957fb44388ec2e99 (diff)
downloadcpython-5a493e9dc4f83e7e2a67dc38b7d2b886a6ee8960.zip
cpython-5a493e9dc4f83e7e2a67dc38b7d2b886a6ee8960.tar.gz
cpython-5a493e9dc4f83e7e2a67dc38b7d2b886a6ee8960.tar.bz2
Merge issue #27196 from 3.5: Stop IDLE test 'application destroyed' warnings.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/idlelib/idle_test/README.txt6
-rw-r--r--Lib/idlelib/idle_test/test_configdialog.py6
-rw-r--r--Lib/idlelib/idle_test/test_parenmatch.py9
-rw-r--r--Lib/idlelib/idle_test/test_redirector.py6
-rw-r--r--Lib/idlelib/idle_test/test_textview.py3
5 files changed, 20 insertions, 10 deletions
diff --git a/Lib/idlelib/idle_test/README.txt b/Lib/idlelib/idle_test/README.txt
index 39a19d0..01b31f6 100644
--- a/Lib/idlelib/idle_test/README.txt
+++ b/Lib/idlelib/idle_test/README.txt
@@ -71,9 +71,15 @@ deleted BEFORE root is destroyed. See https://bugs.python.org/issue20567.
@classmethod
def tearDownClass(cls):
del cls.text
+ cls.root.update_idletasks()
cls.root.destroy()
del cls.root
+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:
diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py
index 3188432..e4e1a31 100644
--- a/Lib/idlelib/idle_test/test_configdialog.py
+++ b/Lib/idlelib/idle_test/test_configdialog.py
@@ -1,7 +1,6 @@
-'''Unittests for idlelib/config.py
+'''Test idlelib.configdialog.
Coverage: 46% just by creating dialog. The other half is change code.
-
'''
import unittest
from test.support import requires
@@ -20,11 +19,12 @@ class ConfigDialogTest(unittest.TestCase):
@classmethod
def tearDownClass(cls):
+ cls.root.update_idletasks()
cls.root.destroy()
del cls.root
def test_dialog(self):
- d=ConfigDialog(self.root, 'Test', _utest=True)
+ d = ConfigDialog(self.root, 'Test', _utest=True)
d.remove_var_callbacks()
d.destroy()
diff --git a/Lib/idlelib/idle_test/test_parenmatch.py b/Lib/idlelib/idle_test/test_parenmatch.py
index 794a3aa..d467a9a 100644
--- 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()
cls.root.destroy()
del cls.root
diff --git a/Lib/idlelib/idle_test/test_redirector.py b/Lib/idlelib/idle_test/test_redirector.py
index df2b618..c8dd118 100644
--- a/Lib/idlelib/idle_test/test_redirector.py
+++ b/Lib/idlelib/idle_test/test_redirector.py
@@ -1,7 +1,7 @@
-"""Unittest for idlelib.redirector
+'''Test idlelib.redirector.
100% coverage
-"""
+'''
from test.support import requires
import unittest
from idlelib.idle_test.mock_idle import Func
@@ -48,8 +48,8 @@ class WidgetRedirectorTest(unittest.TestCase):
@classmethod
def tearDownClass(cls):
- cls.text.destroy()
del cls.text
+ cls.root.update_idletasks()
cls.root.destroy()
del cls.root
diff --git a/Lib/idlelib/idle_test/test_textview.py b/Lib/idlelib/idle_test/test_textview.py
index 084928f..4c70ebb 100644
--- 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
+ root.update_idletasks()
root.destroy() # pyflakes falsely sees root as undefined
del root