| 
									
										
										
										
											2013-07-28 00:00:20 -04:00
										 |  |  | import unittest | 
					
						
							| 
									
										
										
										
											2020-07-06 20:29:49 +08:00
										 |  |  | from test.support.import_helper import import_module | 
					
						
							| 
									
										
										
										
											2022-01-25 23:14:03 +00:00
										 |  |  | from test.support import check_sanitizer | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if check_sanitizer(address=True, memory=True): | 
					
						
							|  |  |  |     raise unittest.SkipTest("Tests involvin libX11 can SEGFAULT on ASAN/MSAN builds") | 
					
						
							| 
									
										
										
										
											2013-07-28 00:00:20 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 13:24:04 -04:00
										 |  |  | # Skip test_idle if _tkinter wasn't built, if tkinter is missing, | 
					
						
							|  |  |  | # if tcl/tk is not the 8.5+ needed for ttk widgets, | 
					
						
							|  |  |  | # or if idlelib is missing (not installed). | 
					
						
							|  |  |  | tk = import_module('tkinter')  # Also imports _tkinter. | 
					
						
							| 
									
										
										
										
											2016-06-09 21:09:15 -04:00
										 |  |  | if tk.TkVersion < 8.5: | 
					
						
							|  |  |  |     raise unittest.SkipTest("IDLE requires tk 8.5 or later.") | 
					
						
							| 
									
										
										
										
											2016-06-26 17:48:02 -04:00
										 |  |  | idlelib = import_module('idlelib') | 
					
						
							| 
									
										
										
										
											2013-05-27 21:32:03 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 13:24:04 -04:00
										 |  |  | # Before importing and executing more of idlelib, | 
					
						
							|  |  |  | # tell IDLE to avoid changing the environment. | 
					
						
							| 
									
										
										
										
											2016-08-16 00:10:14 -04:00
										 |  |  | idlelib.testing = True | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 13:24:04 -04:00
										 |  |  | # Unittest.main and test.libregrtest.runtest.runtest_inner | 
					
						
							|  |  |  | # call load_tests, when present here, to discover tests to run. | 
					
						
							| 
									
										
										
										
											2016-06-26 17:48:02 -04:00
										 |  |  | from idlelib.idle_test import load_tests | 
					
						
							| 
									
										
										
										
											2013-05-27 21:32:03 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | if __name__ == '__main__': | 
					
						
							| 
									
										
										
										
											2016-08-16 00:10:14 -04:00
										 |  |  |     tk.NoDefaultRoot() | 
					
						
							|  |  |  |     unittest.main(exit=False) | 
					
						
							| 
									
										
										
										
											2020-12-19 12:17:08 +02:00
										 |  |  |     tk._support_default_root = True | 
					
						
							| 
									
										
										
										
											2016-07-25 00:31:54 -04:00
										 |  |  |     tk._default_root = None |