GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.6] bpo-33855: Minimally test all IDLE modules. (GH-7689) (GH-7734) · python/cpython@833b3d2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Lib/idlelib
    • autocomplete.py
    • autocomplete_w.py
    • calltip_w.py
    • colorizer.py
    • debugger.py
    • debugger_r.py
    • debugobj.py
    • debugobj_r.py
    • editor.py
    • filelist.py
    • grep.py
    • help.py
    • idle_test
      • template.py
      • test_autocomplete.py
      • test_autocomplete_w.py
      • test_autoexpand.py
      • test_browser.py
      • test_calltip_w.py
      • test_calltips.py
      • test_codecontext.py
      • test_colorizer.py
      • test_config.py
      • test_config_key.py
      • test_configdialog.py
      • test_debugger.py
      • test_debugger_r.py
      • test_debugobj.py
      • test_debugobj_r.py
      • test_delegator.py
      • test_editor.py
      • test_filelist.py
      • test_grep.py
      • test_help.py
  • Misc/NEWS.d/next/IDLE
    • 2018-06-14-11-35-50.bpo-33855.XL230W.rst
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Lib/idlelib/autocomplete.py‎

Copy file name to clipboardExpand all lines: Lib/idlelib/autocomplete.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ def get_entity(self, name):
226226

227227
AutoComplete.reload()
228228

229-
230229
if __name__ == '__main__':
231230
from unittest import main
232231
main('idlelib.idle_test.test_autocomplete', verbosity=2)
Collapse file

‎Lib/idlelib/autocomplete_w.py‎

Copy file name to clipboardExpand all lines: Lib/idlelib/autocomplete_w.py
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,3 +458,10 @@ def hide_window(self):
458458
self.listbox = None
459459
self.autocompletewindow.destroy()
460460
self.autocompletewindow = None
461+
462+
463+
if __name__ == '__main__':
464+
from unittest import main
465+
main('idlelib.idle_test.test_autocomplete_w', verbosity=2, exit=False)
466+
467+
# TODO: autocomplete/w htest here
Collapse file

‎Lib/idlelib/calltip_w.py‎

Copy file name to clipboardExpand all lines: Lib/idlelib/calltip_w.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ def calltip_hide(event):
159159
text.bind("<<calltip-hide>>", calltip_hide)
160160
text.focus_set()
161161

162-
if __name__=='__main__':
162+
if __name__ == '__main__':
163+
from unittest import main
164+
main('idlelib.idle_test.test_calltips', verbosity=2, exit=False)
165+
163166
from idlelib.idle_test.htest import run
164167
run(_calltip_window)
Collapse file

‎Lib/idlelib/colorizer.py‎

Copy file name to clipboardExpand all lines: Lib/idlelib/colorizer.py
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,8 @@ def _color_delegator(parent): # htest #
286286
p.insertfilter(d)
287287

288288
if __name__ == "__main__":
289-
import unittest
290-
unittest.main('idlelib.idle_test.test_colorizer',
291-
verbosity=2, exit=False)
289+
from unittest import main
290+
main('idlelib.idle_test.test_colorizer', verbosity=2, exit=False)
292291

293292
from idlelib.idle_test.htest import run
294293
run(_color_delegator)
Collapse file

‎Lib/idlelib/debugger.py‎

Copy file name to clipboardExpand all lines: Lib/idlelib/debugger.py
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class Idb(bdb.Bdb):
1313

1414
def __init__(self, gui):
15-
self.gui = gui
15+
self.gui = gui # An instance of Debugger or proxy of remote.
1616
bdb.Bdb.__init__(self)
1717

1818
def user_line(self, frame):
@@ -63,7 +63,7 @@ def __init__(self, pyshell, idb=None):
6363
if idb is None:
6464
idb = Idb(self)
6565
self.pyshell = pyshell
66-
self.idb = idb
66+
self.idb = idb # If passed, a proxy of remote instance.
6767
self.frame = None
6868
self.make_gui()
6969
self.interacting = 0
@@ -542,3 +542,9 @@ def load_dict(self, dict, force=0, rpc_client=None):
542542

543543
def close(self):
544544
self.frame.destroy()
545+
546+
if __name__ == "__main__":
547+
from unittest import main
548+
main('idlelib.idle_test.test_debugger', verbosity=2, exit=False)
549+
550+
# TODO: htest?
Collapse file

‎Lib/idlelib/debugger_r.py‎

Copy file name to clipboardExpand all lines: Lib/idlelib/debugger_r.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,3 +386,8 @@ def restart_subprocess_debugger(rpcclt):
386386
idb_adap_oid_ret = rpcclt.remotecall("exec", "start_the_debugger",\
387387
(gui_adap_oid,), {})
388388
assert idb_adap_oid_ret == idb_adap_oid, 'Idb restarted with different oid'
389+
390+
391+
if __name__ == "__main__":
392+
from unittest import main
393+
main('idlelib.idle_test.test_debugger', verbosity=2, exit=False)
Collapse file

‎Lib/idlelib/debugobj.py‎

Copy file name to clipboardExpand all lines: Lib/idlelib/debugobj.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def GetSubList(self):
7171

7272
class AtomicObjectTreeItem(ObjectTreeItem):
7373
def IsExpandable(self):
74-
return 0
74+
return False
7575

7676
class SequenceTreeItem(ObjectTreeItem):
7777
def IsExpandable(self):
@@ -135,5 +135,8 @@ def _object_browser(parent): # htest #
135135
node.update()
136136

137137
if __name__ == '__main__':
138+
from unittest import main
139+
main('idlelib.idle_test.test_debugobj', verbosity=2, exit=False)
140+
138141
from idlelib.idle_test.htest import run
139142
run(_object_browser)
Collapse file

‎Lib/idlelib/debugobj_r.py‎

Copy file name to clipboardExpand all lines: Lib/idlelib/debugobj_r.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@ def __getattr__(self, name):
3434
def _GetSubList(self):
3535
sub_list = self.sockio.remotecall(self.oid, "_GetSubList", (), {})
3636
return [StubObjectTreeItem(self.sockio, oid) for oid in sub_list]
37+
38+
39+
if __name__ == '__main__':
40+
from unittest import main
41+
main('idlelib.idle_test.test_debugobj_r', verbosity=2)
Collapse file

‎Lib/idlelib/editor.py‎

Copy file name to clipboardExpand all lines: Lib/idlelib/editor.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,8 +1706,8 @@ def _editor_window(parent): # htest #
17061706
# edit.text.bind("<<close-window>>", edit.close_event)
17071707

17081708
if __name__ == '__main__':
1709-
import unittest
1710-
unittest.main('idlelib.idle_test.test_editor', verbosity=2, exit=False)
1709+
from unittest import main
1710+
main('idlelib.idle_test.test_editor', verbosity=2, exit=False)
17111711

17121712
from idlelib.idle_test.htest import run
17131713
run(_editor_window)
Collapse file

‎Lib/idlelib/filelist.py‎

Copy file name to clipboardExpand all lines: Lib/idlelib/filelist.py
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import os
1+
"idlelib.filelist"
22

3-
from tkinter import *
4-
import tkinter.messagebox as tkMessageBox
3+
import os
4+
from tkinter import messagebox as tkMessageBox
55

66

77
class FileList:
@@ -111,7 +111,8 @@ def canonize(self, filename):
111111
return os.path.normpath(filename)
112112

113113

114-
def _test():
114+
def _test(): # TODO check and convert to htest
115+
from tkinter import Tk
115116
from idlelib.editor import fixwordbreaks
116117
from idlelib.run import fix_scaling
117118
import sys
@@ -120,13 +121,12 @@ def _test():
120121
fixwordbreaks(root)
121122
root.withdraw()
122123
flist = FileList(root)
123-
if sys.argv[1:]:
124-
for filename in sys.argv[1:]:
125-
flist.open(filename)
126-
else:
127-
flist.new()
124+
flist.new()
128125
if flist.inversedict:
129126
root.mainloop()
130127

131128
if __name__ == '__main__':
132-
_test()
129+
from unittest import main
130+
main('idlelib.idle_test.test_filelist', verbosity=2)
131+
132+
# _test()

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.