Issue #21477: Idle htest: merge and modify run and runall; add many tests.

Patch by Saimadhav Heblikar
This commit is contained in:
Terry Jan Reedy 2014-05-24 18:48:18 -04:00
parent 10cbb1e463
commit 1b392ffe67
18 changed files with 412 additions and 179 deletions

View file

@ -1,13 +1,20 @@
import os
import sys
import re
import importlib.machinery
from idlelib.TreeWidget import TreeItem
from idlelib.ClassBrowser import ClassBrowser, ModuleBrowserTreeItem
from idlelib.PyShell import PyShellFileList
class PathBrowser(ClassBrowser):
def __init__(self, flist):
def __init__(self, flist, _htest=False):
"""
_htest - bool, change box location when running htest
"""
self._htest = _htest
self.init(flist)
def settitle(self):
@ -87,12 +94,13 @@ class DirBrowserTreeItem(TreeItem):
sorted.sort()
return sorted
def main():
from idlelib import PyShell
PathBrowser(PyShell.flist)
if sys.stdin is sys.__stdin__:
mainloop()
def _path_browser(parent):
flist = PyShellFileList(parent)
PathBrowser(flist, _htest=True)
if __name__ == "__main__":
from unittest import main
main('idlelib.idle_test.test_pathbrowser', verbosity=2, exit=False)
from idlelib.idle_test.htest import run
run(_path_browser)