2013-07-28 01:00:20 -03:00
|
|
|
import unittest
|
2014-05-02 12:51:07 -03:00
|
|
|
from test.support import import_module
|
2013-07-28 01:00:20 -03:00
|
|
|
|
2017-09-18 18:50:44 -03:00
|
|
|
# Skip test if _tkinter wasn't built, if idlelib is missing,
|
2016-08-16 01:10:14 -03:00
|
|
|
# or if tcl/tk is not the 8.5+ needed for ttk widgets.
|
2013-07-28 01:00:20 -03:00
|
|
|
tk = import_module('tkinter') # imports _tkinter
|
2016-06-09 22:09:15 -03:00
|
|
|
if tk.TkVersion < 8.5:
|
|
|
|
raise unittest.SkipTest("IDLE requires tk 8.5 or later.")
|
2016-06-26 18:48:02 -03:00
|
|
|
idlelib = import_module('idlelib')
|
2013-05-27 22:32:03 -03:00
|
|
|
|
2016-08-16 01:10:14 -03:00
|
|
|
# Before test imports, tell IDLE to avoid changing the environment.
|
|
|
|
idlelib.testing = True
|
|
|
|
|
|
|
|
# unittest.main and test.libregrtest.runtest.runtest_inner
|
|
|
|
# call load_tests, when present, to discover tests to run.
|
2016-06-26 18:48:02 -03:00
|
|
|
from idlelib.idle_test import load_tests
|
2013-05-27 22:32:03 -03:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2016-08-16 01:10:14 -03:00
|
|
|
tk.NoDefaultRoot()
|
|
|
|
unittest.main(exit=False)
|
2016-07-25 01:31:54 -03:00
|
|
|
tk._support_default_root = 1
|
|
|
|
tk._default_root = None
|