1 import unittest
2 from test.support.import_helper import import_module
3 from test.support import check_sanitizer
4
5 if check_sanitizer(address=True, memory=True):
6 raise unittest.SkipTest("Tests involving libX11 can SEGFAULT on ASAN/MSAN builds")
7
8 # Skip test_idle if _tkinter, tkinter, or idlelib are missing.
9 tk = import_module('tkinter') # Also imports _tkinter.
10 idlelib = import_module('idlelib')
11
12 # Before importing and executing more of idlelib,
13 # tell IDLE to avoid changing the environment.
14 idlelib.testing = True
15
16 # Unittest.main and test.libregrtest.runtest.runtest_inner
17 # call load_tests, when present here, to discover tests to run.
18 from idlelib.idle_test import load_tests
19
20 if __name__ == '__main__':
21 tk.NoDefaultRoot()
22 unittest.main(exit=False)
23 tk._support_default_root = True
24 tk._default_root = None