MCPcopy Index your code
hub / github.com/python/cpython / get_test_tk_root

Function get_test_tk_root

Lib/idlelib/idle_test/test_squeezer.py:20–31  ·  view source on GitHub ↗

Helper for tests: Create a root Tk object.

(test_instance)

Source from the content-addressed store, hash-verified

18
19
20def get_test_tk_root(test_instance):
21 """Helper for tests: Create a root Tk object."""
22 requires('gui')
23 root = Tk()
24 root.withdraw()
25
26 def cleanup_root():
27 root.update_idletasks()
28 root.destroy()
29 test_instance.addCleanup(cleanup_root)
30
31 return root
32
33
34class CountLinesTest(unittest.TestCase):

Callers 3

make_text_widgetMethod · 0.85
make_mock_squeezerMethod · 0.85

Calls 3

requiresFunction · 0.90
TkClass · 0.90
addCleanupMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…