[Python-checkins] [2.7] Fix 2.7 test -R test_IDLE failure on Windows (GH-13958)

Terry Jan Reedy webhook-mailer at python.org
Sun Jun 16 16:36:27 EDT 2019


https://github.com/python/cpython/commit/722733e940199ce8957254236e2aa7c453044fde
commit: 722733e940199ce8957254236e2aa7c453044fde
branch: 2.7
author: Terry Jan Reedy <tjreedy at udel.edu>
committer: GitHub <noreply at github.com>
date: 2019-06-16T16:36:23-04:00
summary:

[2.7] Fix 2.7 test -R test_IDLE failure on Windows (GH-13958)

Cherry-picked from 66d47da.

files:
M Lib/idlelib/idle_test/test_searchdialogbase.py

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 @@ def test_open_and_close(self):
         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 @@ def test_open_and_close(self):
 
         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()



More information about the Python-checkins mailing list