• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import unittest
2from test.support.import_helper import import_module
3from test.support import check_sanitizer
4
5if check_sanitizer(address=True, memory=True):
6    raise unittest.SkipTest("Tests involvin libX11 can SEGFAULT on ASAN/MSAN builds")
7
8# Skip test_idle if _tkinter wasn't built, if tkinter is missing,
9# if tcl/tk is not the 8.5+ needed for ttk widgets,
10# or if idlelib is missing (not installed).
11tk = import_module('tkinter')  # Also imports _tkinter.
12if tk.TkVersion < 8.5:
13    raise unittest.SkipTest("IDLE requires tk 8.5 or later.")
14idlelib = import_module('idlelib')
15
16# Before importing and executing more of idlelib,
17# tell IDLE to avoid changing the environment.
18idlelib.testing = True
19
20# Unittest.main and test.libregrtest.runtest.runtest_inner
21# call load_tests, when present here, to discover tests to run.
22from idlelib.idle_test import load_tests
23
24if __name__ == '__main__':
25    tk.NoDefaultRoot()
26    unittest.main(exit=False)
27    tk._support_default_root = True
28    tk._default_root = None
29