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