From: Terry Jan Reedy Date: Sun, 16 Jun 2019 20:36:23 +0000 (-0400) Subject: [2.7] Fix 2.7 test -R test_IDLE failure on Windows (GH-13958) X-Git-Tag: v2.7.17rc1~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=722733e940199ce8957254236e2aa7c453044fde;p=thirdparty%2FPython%2Fcpython.git [2.7] Fix 2.7 test -R test_IDLE failure on Windows (GH-13958) Cherry-picked from 66d47da. --- diff --git a/Lib/idlelib/idle_test/test_searchdialogbase.py b/Lib/idlelib/idle_test/test_searchdialogbase.py index 7ca6bbf69347..59b9bbf30f2e 100644 --- a/Lib/idlelib/idle_test/test_searchdialogbase.py +++ b/Lib/idlelib/idle_test/test_searchdialogbase.py @@ -46,7 +46,6 @@ class SearchDialogBaseTest(unittest.TestCase): self.dialog.default_command = None toplevel = Toplevel(self.root) - self.addCleanup(toplevel.destroy) text = Text(toplevel) self.dialog.open(text) self.assertEqual(self.dialog.top.state(), 'normal') @@ -55,7 +54,8 @@ class SearchDialogBaseTest(unittest.TestCase): self.dialog.open(text, searchphrase="hello") self.assertEqual(self.dialog.ent.get(), 'hello') - self.dialog.close() + toplevel.update_idletasks() + toplevel.destroy() def test_create_widgets(self): self.dialog.create_entries = Func()