mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #21477: Idle htest: merge and modify run and runall; add many tests.
Patch by Saimadhav Heblikar
This commit is contained in:
parent
10cbb1e463
commit
1b392ffe67
18 changed files with 412 additions and 179 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue