diff options
| author | Tal Einat <taleinat@gmail.com> | 2019-06-07 05:54:40 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-07 05:54:40 (GMT) |
| commit | 554450fb4e95066e825bdb4a2d544a490daeebdc (patch) | |
| tree | dc68d632f8f78a161b53ad6d998b96da0fc99a1b /Lib/idlelib/idle_test/test_searchbase.py | |
| parent | de76c07a8cd0216c3dce215e4d542e2f45aa022f (diff) | |
| download | cpython-554450fb4e95066e825bdb4a2d544a490daeebdc.zip cpython-554450fb4e95066e825bdb4a2d544a490daeebdc.tar.gz cpython-554450fb4e95066e825bdb4a2d544a490daeebdc.tar.bz2 | |
bpo-37177: make IDLE's search dialogs transient (GH-13869)
This avoids the search dialogs being hidden behind the editor window.
Diffstat (limited to 'Lib/idlelib/idle_test/test_searchbase.py')
| -rw-r--r-- | Lib/idlelib/idle_test/test_searchbase.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/idlelib/idle_test/test_searchbase.py b/Lib/idlelib/idle_test/test_searchbase.py index 6dd4d79..e08268f 100644 --- a/Lib/idlelib/idle_test/test_searchbase.py +++ b/Lib/idlelib/idle_test/test_searchbase.py @@ -4,7 +4,7 @@ import unittest from test.support import requires -from tkinter import Tk +from tkinter import Text, Tk, Toplevel from tkinter.ttk import Frame from idlelib import searchengine as se from idlelib import searchbase as sdb @@ -47,14 +47,15 @@ class SearchDialogBaseTest(unittest.TestCase): # open calls create_widgets, which needs default_command self.dialog.default_command = None - # Since text parameter of .open is not used in base class, - # pass dummy 'text' instead of tk.Text(). - self.dialog.open('text') + toplevel = Toplevel(self.root) + self.addCleanup(toplevel.destroy) + text = Text(toplevel) + self.dialog.open(text) self.assertEqual(self.dialog.top.state(), 'normal') self.dialog.close() self.assertEqual(self.dialog.top.state(), 'withdrawn') - self.dialog.open('text', searchphrase="hello") + self.dialog.open(text, searchphrase="hello") self.assertEqual(self.dialog.ent.get(), 'hello') self.dialog.close() |
