|
1 | 1 | import unittest
|
2 | 2 | from test.support import import_module
|
3 | 3 |
|
4 |
| -# Skip test if _thread or _tkinter wasn't built, if idlelib is missing, |
5 |
| -# or if tcl/tk is not the 8.5+ needed for ttk widgets. |
6 |
| -import_module('threading') # imported by PyShell, imports _thread |
| 4 | +# For 3.6, skip test_idle if threads are not supported. |
| 5 | +import_module('threading') # Imported by PyShell, imports _thread. |
| 6 | + |
| 7 | +# Skip test_idle if _tkinter wasn't built, if tkinter is missing, |
| 8 | +# if tcl/tk is not the 8.5+ needed for ttk widgets, |
| 9 | +# or if idlelib is missing (not installed). |
7 | 10 | tk = import_module('tkinter') # imports _tkinter
|
8 | 11 | if tk.TkVersion < 8.5:
|
9 | 12 | raise unittest.SkipTest("IDLE requires tk 8.5 or later.")
|
10 | 13 | idlelib = import_module('idlelib')
|
11 | 14 |
|
12 |
| -# Before test imports, tell IDLE to avoid changing the environment. |
| 15 | +# Before importing and executing more of idlelib, |
| 16 | +# tell IDLE to avoid changing the environment. |
13 | 17 | idlelib.testing = True
|
14 | 18 |
|
15 |
| -# unittest.main and test.libregrtest.runtest.runtest_inner |
16 |
| -# call load_tests, when present, to discover tests to run. |
| 19 | +# Unittest.main and test.libregrtest.runtest.runtest_inner |
| 20 | +# call load_tests, when present here, to discover tests to run. |
17 | 21 | from idlelib.idle_test import load_tests
|
18 | 22 |
|
19 | 23 | if __name__ == '__main__':
|
|
0 commit comments