Visitar URL original
Issue #25507: move test-specific imports to test function (idlelib.IO… · python/cpython@bbdc065 · GitHub
Skip to content

Commit bbdc065

Browse files
committed
Issue #25507: move test-specific imports to test function (idlelib.IOBinding).
1 parent dcc13ef commit bbdc065

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

‎Lib/idlelib/IOBinding.py‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1+
import codecs
2+
from codecs import BOM_UTF8
13
import os
4+
import re
25
import shlex
36
import sys
4-
import codecs
57
import tempfile
8+
69
import tkinter.filedialog as tkFileDialog
710
import tkinter.messagebox as tkMessageBox
8-
import re
9-
from tkinter import *
1011
from tkinter.simpledialog import askstring
1112

12-
from idlelib.configHandler import idleConf
1313

14-
from codecs import BOM_UTF8
1514

1615
# Try setting the locale, so that we can find out
1716
# what encoding to use
@@ -525,7 +524,10 @@ def updaterecentfileslist(self,filename):
525524
self.editwin.update_recent_files_list(filename)
526525

527526
def _io_binding(parent): # htest #
528-
root = Tk()
527+
from tkinter import Toplevel, Text
528+
from idlelib.configHandler import idleConf
529+
530+
root = Toplevel(parent)
529531
root.title("Test IOBinding")
530532
width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
531533
root.geometry("+%d+%d"%(x, y + 150))

‎Lib/idlelib/idle_test/htest.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,11 @@ def _wrapper(parent): # htest #
189189
_io_binding_spec = {
190190
'file': 'IOBinding',
191191
'kwds': {},
192-
'msg': "Test the following bindings\n"
193-
"<Control-o> to display open window from file dialog.\n"
194-
"<Control-s> to save the file\n"
192+
'msg': "Test the following bindings.\n"
193+
"<Control-o> to open file from dialog.\n"
194+
"Edit the file.\n"
195+
"<Control-s> to save the file.\n"
196+
"Check that changes were saved by opening the file elsewhere."
195197
}
196198

197199
_multi_call_spec = {

0 commit comments

Comments
 (0)