changeset: 98897:38b6b7253ba1 branch: 3.4 parent: 98893:114fb81a08e3 user: Terry Jan Reedy date: Fri Oct 30 02:47:06 2015 -0400 files: Lib/idlelib/IOBinding.py Lib/idlelib/idle_test/htest.py description: Issue #25507: move test-specific imports to test function (idlelib.IOBinding). diff -r 114fb81a08e3 -r 38b6b7253ba1 Lib/idlelib/IOBinding.py --- a/Lib/idlelib/IOBinding.py Thu Oct 29 21:10:57 2015 -0700 +++ b/Lib/idlelib/IOBinding.py Fri Oct 30 02:47:06 2015 -0400 @@ -1,17 +1,16 @@ +import codecs +from codecs import BOM_UTF8 import os +import re import shlex import sys -import codecs import tempfile + import tkinter.filedialog as tkFileDialog import tkinter.messagebox as tkMessageBox -import re -from tkinter import * from tkinter.simpledialog import askstring -from idlelib.configHandler import idleConf -from codecs import BOM_UTF8 # Try setting the locale, so that we can find out # what encoding to use @@ -525,7 +524,10 @@ self.editwin.update_recent_files_list(filename) def _io_binding(parent): # htest # - root = Tk() + from tkinter import Toplevel, Text + from idlelib.configHandler import idleConf + + root = Toplevel(parent) root.title("Test IOBinding") width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) root.geometry("+%d+%d"%(x, y + 150)) diff -r 114fb81a08e3 -r 38b6b7253ba1 Lib/idlelib/idle_test/htest.py --- a/Lib/idlelib/idle_test/htest.py Thu Oct 29 21:10:57 2015 -0700 +++ b/Lib/idlelib/idle_test/htest.py Fri Oct 30 02:47:06 2015 -0400 @@ -189,9 +189,11 @@ _io_binding_spec = { 'file': 'IOBinding', 'kwds': {}, - 'msg': "Test the following bindings\n" - " to display open window from file dialog.\n" - " to save the file\n" + 'msg': "Test the following bindings.\n" + " to open file from dialog.\n" + "Edit the file.\n" + " to save the file.\n" + "Check that changes were saved by opening the file elsewhere." } _multi_call_spec = {