summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/textView.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2014-06-05 07:38:28 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2014-06-05 07:38:28 (GMT)
commit562495ab6150eb2eae346dcc9f06f3d5173d9a3a (patch)
tree5d8e3f177bbb37c5386f8ae465aecb0066f29416 /Lib/idlelib/textView.py
parent6e66cb03b7b8ee12d95f66175fe8061cdb188fa4 (diff)
downloadcpython-562495ab6150eb2eae346dcc9f06f3d5173d9a3a.zip
cpython-562495ab6150eb2eae346dcc9f06f3d5173d9a3a.tar.gz
cpython-562495ab6150eb2eae346dcc9f06f3d5173d9a3a.tar.bz2
Issue #18910: Add unittest for textView. Patch by Phil Webster.
Diffstat (limited to 'Lib/idlelib/textView.py')
-rw-r--r--Lib/idlelib/textView.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/idlelib/textView.py b/Lib/idlelib/textView.py
index 4716d39..eb60274 100644
--- a/Lib/idlelib/textView.py
+++ b/Lib/idlelib/textView.py
@@ -12,7 +12,11 @@ class TextViewer(Toplevel):
def __init__(self, parent, title, text, modal=True, _htest=False):
"""Show the given text in a scrollable window with a 'close' button
- _htest - bool, change box location when running htest
+ If modal option set to False, user can interact with other windows,
+ otherwise they will be unable to interact with other windows until
+ the textview window is closed.
+
+ _htest - bool; change box location when running htest.
"""
Toplevel.__init__(self, parent)
self.configure(borderwidth=5)
@@ -72,7 +76,6 @@ def view_file(parent, title, filename, encoding=None, modal=True):
else:
textFile = open(filename, 'r')
except IOError:
- import tkMessageBox
tkMessageBox.showerror(title='File Load Error',
message='Unable to load file %r .' % filename,
parent=parent)
@@ -81,5 +84,7 @@ def view_file(parent, title, filename, encoding=None, modal=True):
if __name__ == '__main__':
+ import unittest
+ unittest.main('idlelib.idle_test.test_textview', verbosity=2, exit=False)
from idlelib.idle_test.htest import run
run(TextViewer)