| 
									
										
										
										
											2013-07-28 00:00:20 -04:00
										 |  |  | import unittest | 
					
						
							| 
									
										
										
										
											2014-05-02 10:51:07 -05:00
										 |  |  | from test.support import import_module | 
					
						
							| 
									
										
										
										
											2013-07-28 00:00:20 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-16 00:10:14 -04:00
										 |  |  | # Skip test if _thread or _tkinter wasn't built, if idlelib is missing, | 
					
						
							|  |  |  | # or if tcl/tk is not the 8.5+ needed for ttk widgets. | 
					
						
							| 
									
										
										
										
											2013-05-28 22:21:53 -04:00
										 |  |  | import_module('threading')  # imported by PyShell, imports _thread | 
					
						
							| 
									
										
										
										
											2013-07-28 00:00:20 -04:00
										 |  |  | tk = import_module('tkinter')  # 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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-16 00:10:14 -04: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 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) | 
					
						
							| 
									
										
										
										
											2016-07-25 00:31:54 -04:00
										 |  |  |     tk._support_default_root = 1 | 
					
						
							|  |  |  |     tk._default_root = None |