• 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    # See gh-90791 for details
7    raise unittest.SkipTest("Tests involving libX11 can SEGFAULT on ASAN/MSAN builds")
8
9# Skip test_idle if _tkinter, tkinter, or idlelib are missing.
10tk = import_module('tkinter')  # Also imports _tkinter.
11idlelib = import_module('idlelib')
12
13# Before importing and executing more of idlelib,
14# tell IDLE to avoid changing the environment.
15idlelib.testing = True
16
17# Unittest.main and test.libregrtest.runtest.runtest_inner
18# call load_tests, when present here, to discover tests to run.
19from idlelib.idle_test import load_tests
20
21if __name__ == '__main__':
22    tk.NoDefaultRoot()
23    unittest.main(exit=False)
24    tk._support_default_root = True
25    tk._default_root = None
26