summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle_test/test_textview.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-09-01 01:09:02 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2016-09-01 01:09:02 (GMT)
commit5f30f7935701cb0c62f498753ad79f19f24f10a1 (patch)
treefe700ba6c930695c39de50d9719fbacc5c6cdc45 /Lib/idlelib/idle_test/test_textview.py
parenta3623c864bd058a184abeb4163faac8a4e809cc5 (diff)
parent00b1e0f7ea1523813e3d407bfdefdf55592566af (diff)
downloadcpython-5f30f7935701cb0c62f498753ad79f19f24f10a1.zip
cpython-5f30f7935701cb0c62f498753ad79f19f24f10a1.tar.gz
cpython-5f30f7935701cb0c62f498753ad79f19f24f10a1.tar.bz2
Issue #27922: IDLE tests no longer flash tk widgets (Merge 3.5).
Diffstat (limited to 'Lib/idlelib/idle_test/test_textview.py')
-rw-r--r--Lib/idlelib/idle_test/test_textview.py14
1 files changed, 8 insertions, 6 deletions
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)