ยปCore Development>Code coverage>Lib/test/test_idle.py

Python code coverage for Lib/test/test_idle.py

#countcontent
1n/aimport unittest
2n/afrom test.support import import_module
3n/a
4n/a# Skip test if _thread or _tkinter wasn't built, if idlelib is missing,
5n/a# or if tcl/tk is not the 8.5+ needed for ttk widgets.
6n/aimport_module('threading') # imported by PyShell, imports _thread
7n/atk = import_module('tkinter') # imports _tkinter
8n/aif tk.TkVersion < 8.5:
9n/a raise unittest.SkipTest("IDLE requires tk 8.5 or later.")
10n/aidlelib = import_module('idlelib')
11n/a
12n/a# Before test imports, tell IDLE to avoid changing the environment.
13n/aidlelib.testing = True
14n/a
15n/a# unittest.main and test.libregrtest.runtest.runtest_inner
16n/a# call load_tests, when present, to discover tests to run.
17n/afrom idlelib.idle_test import load_tests
18n/a
19n/aif __name__ == '__main__':
20n/a tk.NoDefaultRoot()
21n/a unittest.main(exit=False)
22n/a tk._support_default_root = 1
23n/a tk._default_root = None