mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
Issue #22629: Revise idle_test.htest, mostly docstring. Start revision of
htests to add # htest # marker for coveragepy and stop tcl errors.
This commit is contained in:
parent
9a6f8e1866
commit
cd567365c9
8 changed files with 110 additions and 80 deletions
|
|
@ -2,7 +2,6 @@
|
|||
import re
|
||||
import keyword
|
||||
import builtins
|
||||
from tkinter import *
|
||||
from idlelib.Delegator import Delegator
|
||||
from idlelib.configHandler import idleConf
|
||||
|
||||
|
|
@ -234,20 +233,23 @@ def removecolors(self):
|
|||
for tag in self.tagdefs:
|
||||
self.tag_remove(tag, "1.0", "end")
|
||||
|
||||
def _color_delegator(parent):
|
||||
def _color_delegator(parent): # htest #
|
||||
from tkinter import Toplevel, Text
|
||||
from idlelib.Percolator import Percolator
|
||||
root = Tk()
|
||||
root.title("Test ColorDelegator")
|
||||
width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
|
||||
root.geometry("+%d+%d"%(x, y + 150))
|
||||
source = "if somename: x = 'abc' # comment\nprint"
|
||||
text = Text(root, background="white")
|
||||
text.insert("insert", source)
|
||||
|
||||
top = Toplevel(parent)
|
||||
top.title("Test ColorDelegator")
|
||||
top.geometry("200x100+%d+%d" % (parent.winfo_rootx() + 200,
|
||||
parent.winfo_rooty() + 150))
|
||||
source = "if somename: x = 'abc' # comment\nprint\n"
|
||||
text = Text(top, background="white")
|
||||
text.pack(expand=1, fill="both")
|
||||
text.insert("insert", source)
|
||||
text.focus_set()
|
||||
|
||||
p = Percolator(text)
|
||||
d = ColorDelegator()
|
||||
p.insertfilter(d)
|
||||
root.mainloop()
|
||||
|
||||
if __name__ == "__main__":
|
||||
from idlelib.idle_test.htest import run
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue