[Python-checkins] bpo-37220: Fix 2.7 test -R crash on Windows. (GH-13957)

Miss Islington (bot) webhook-mailer at python.org
Sun Jun 16 17:10:53 EDT 2019


https://github.com/python/cpython/commit/2acaf496b71224ff6d170ea12b0876d65195be7b
commit: 2acaf496b71224ff6d170ea12b0876d65195be7b
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-06-16T14:10:49-07:00
summary:

bpo-37220: Fix 2.7 test -R crash on Windows. (GH-13957)


The patch needed for 2.7 should make the test more stable on 3.x also.
(cherry picked from commit 66d47da86aff15be34adbec02596bb3188684c0d)

Co-authored-by: Terry Jan Reedy <tjreedy at udel.edu>

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

diff --git a/Lib/idlelib/idle_test/test_searchbase.py b/Lib/idlelib/idle_test/test_searchbase.py
index e08268fde257..aee0c4c69929 100644
--- a/Lib/idlelib/idle_test/test_searchbase.py
+++ b/Lib/idlelib/idle_test/test_searchbase.py
@@ -48,7 +48,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')
@@ -57,7 +56,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