summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/idlelib/idle_test/test_config_key.py1
-rw-r--r--Lib/idlelib/idle_test/test_configdialog.py1
-rw-r--r--Lib/idlelib/idle_test/test_editmenu.py1
-rw-r--r--Lib/idlelib/idle_test/test_history.py1
-rw-r--r--Lib/idlelib/idle_test/test_hyperparser.py1
-rw-r--r--Lib/idlelib/idle_test/test_macosx.py2
-rw-r--r--Lib/idlelib/idle_test/test_query.py4
-rw-r--r--Lib/idlelib/idle_test/test_redirector.py2
-rw-r--r--Lib/idlelib/idle_test/test_textview.py14
9 files changed, 21 insertions, 6 deletions
diff --git a/Lib/idlelib/idle_test/test_config_key.py b/Lib/idlelib/idle_test/test_config_key.py
index 59d8e81..ee3f2c8 100644
--- a/Lib/idlelib/idle_test/test_config_key.py
+++ b/Lib/idlelib/idle_test/test_config_key.py
@@ -14,6 +14,7 @@ class GetKeysTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.root = Tk()
+ cls.root.withdraw()
@classmethod
def tearDownClass(cls):
diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py
index 736b098..70bd14e 100644
--- a/Lib/idlelib/idle_test/test_configdialog.py
+++ b/Lib/idlelib/idle_test/test_configdialog.py
@@ -14,6 +14,7 @@ class ConfigDialogTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.root = Tk()
+ cls.root.withdraw()
@classmethod
def tearDownClass(cls):
diff --git a/Lib/idlelib/idle_test/test_editmenu.py b/Lib/idlelib/idle_test/test_editmenu.py
index 654f060..17eb25c 100644
--- a/Lib/idlelib/idle_test/test_editmenu.py
+++ b/Lib/idlelib/idle_test/test_editmenu.py
@@ -17,6 +17,7 @@ class PasteTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.root = root = tk.Tk()
+ cls.root.withdraw()
pyshell.fix_x11_paste(root)
cls.text = tk.Text(root)
cls.entry = tk.Entry(root)
diff --git a/Lib/idlelib/idle_test/test_history.py b/Lib/idlelib/idle_test/test_history.py
index 6e8269c..b278010 100644
--- a/Lib/idlelib/idle_test/test_history.py
+++ b/Lib/idlelib/idle_test/test_history.py
@@ -68,6 +68,7 @@ class FetchTest(unittest.TestCase):
def setUpClass(cls):
requires('gui')
cls.root = tk.Tk()
+ cls.root.withdraw()
def setUp(self):
self.text = text = TextWrapper(self.root)
diff --git a/Lib/idlelib/idle_test/test_hyperparser.py b/Lib/idlelib/idle_test/test_hyperparser.py
index 067e5b1..73c8281 100644
--- a/Lib/idlelib/idle_test/test_hyperparser.py
+++ b/Lib/idlelib/idle_test/test_hyperparser.py
@@ -37,6 +37,7 @@ class HyperParserTest(unittest.TestCase):
def setUpClass(cls):
requires('gui')
cls.root = Tk()
+ cls.root.withdraw()
cls.text = Text(cls.root)
cls.editwin = DummyEditwin(cls.text)
diff --git a/Lib/idlelib/idle_test/test_macosx.py b/Lib/idlelib/idle_test/test_macosx.py
index 3c6161c..fae75d8 100644
--- a/Lib/idlelib/idle_test/test_macosx.py
+++ b/Lib/idlelib/idle_test/test_macosx.py
@@ -22,6 +22,7 @@ class InitTktypeTest(unittest.TestCase):
def setUpClass(cls):
requires('gui')
cls.root = tk.Tk()
+ cls.root.withdraw()
cls.orig_platform = macosx.platform
@classmethod
@@ -76,6 +77,7 @@ class SetupTest(unittest.TestCase):
def setUpClass(cls):
requires('gui')
cls.root = tk.Tk()
+ cls.root.withdraw()
@classmethod
def tearDownClass(cls):
diff --git a/Lib/idlelib/idle_test/test_query.py b/Lib/idlelib/idle_test/test_query.py
index e9ed694..66af8eb 100644
--- a/Lib/idlelib/idle_test/test_query.py
+++ b/Lib/idlelib/idle_test/test_query.py
@@ -252,6 +252,7 @@ class QueryGuiTest(unittest.TestCase):
def setUpClass(cls):
requires('gui')
cls.root = root = Tk()
+ cls.root.withdraw()
cls.dialog = query.Query(root, 'TEST', 'test', _utest=True)
cls.dialog.destroy = mock.Mock()
@@ -295,6 +296,7 @@ class SectionnameGuiTest(unittest.TestCase):
def test_click_section_name(self):
root = Tk()
+ root.withdraw()
dialog = query.SectionName(root, 'T', 't', {'abc'}, _utest=True)
Equal = self.assertEqual
self.assertEqual(dialog.used_names, {'abc'})
@@ -314,6 +316,7 @@ class ModulenameGuiTest(unittest.TestCase):
def test_click_module_name(self):
root = Tk()
+ root.withdraw()
dialog = query.ModuleName(root, 'T', 't', 'idlelib', _utest=True)
self.assertEqual(dialog.text0, 'idlelib')
self.assertEqual(dialog.entry.get(), 'idlelib')
@@ -332,6 +335,7 @@ class HelpsourceGuiTest(unittest.TestCase):
def test_click_help_source(self):
root = Tk()
+ root.withdraw()
dialog = query.HelpSource(root, 'T', menuitem='__test__',
filepath=__file__, _utest=True)
Equal = self.assertEqual
diff --git a/Lib/idlelib/idle_test/test_redirector.py b/Lib/idlelib/idle_test/test_redirector.py
index c8dd118..b0385fa 100644
--- a/Lib/idlelib/idle_test/test_redirector.py
+++ b/Lib/idlelib/idle_test/test_redirector.py
@@ -15,6 +15,7 @@ class InitCloseTest(unittest.TestCase):
def setUpClass(cls):
requires('gui')
cls.root = Tk()
+ cls.root.withdraw()
cls.text = Text(cls.root)
@classmethod
@@ -44,6 +45,7 @@ class WidgetRedirectorTest(unittest.TestCase):
def setUpClass(cls):
requires('gui')
cls.root = Tk()
+ cls.root.withdraw()
cls.text = Text(cls.root)
@classmethod
diff --git a/Lib/idlelib/idle_test/test_textview.py b/Lib/idlelib/idle_test/test_textview.py
index c1edcb0..f018f5e 100644
--- a/Lib/idlelib/idle_test/test_textview.py
+++ b/Lib/idlelib/idle_test/test_textview.py
@@ -20,15 +20,16 @@ from idlelib.idle_test.mock_tk import Mbox_func
def setUpModule():
global root
root = Tk()
+ root.withdraw()
def tearDownModule():
global root
root.update_idletasks()
- root.destroy() # pyflakes falsely sees root as undefined
+ root.destroy() # Pyflakes falsely sees root as undefined.
del root
-class TV(tv.TextViewer): # used by TextViewTest
+class TV(tv.TextViewer): # Used in TextViewTest.
transient = Func()
grab_set = Func()
wait_window = Func()
@@ -59,8 +60,8 @@ class TextViewTest(unittest.TestCase):
view.destroy = Func()
view.Ok()
self.assertTrue(view.destroy.called)
- del view.destroy # unmask real function
- view.destroy
+ del view.destroy # Unmask real function.
+ view.destroy()
class ViewFunctionTest(unittest.TestCase):
@@ -76,9 +77,10 @@ class ViewFunctionTest(unittest.TestCase):
del cls.orig_error
def test_view_text(self):
- # If modal True, tkinter will error with 'can't invoke "event" command'
+ # If modal True, get tk error 'can't invoke "event" command'.
view = tv.view_text(root, 'Title', 'test text', modal=False)
self.assertIsInstance(view, tv.TextViewer)
+ view.Ok()
def test_view_file(self):
test_dir = os.path.dirname(__file__)
@@ -88,7 +90,7 @@ class ViewFunctionTest(unittest.TestCase):
self.assertIn('Test', view.textView.get('1.0', '1.end'))
view.Ok()
- # Mock showerror will be used and view_file will return None
+ # Mock showerror will be used; view_file will return None.
testfile = os.path.join(test_dir, '../notthere.py')
view = tv.view_file(root, 'Title', testfile, modal=False)
self.assertIsNone(view)