| 
									
										
										
										
											2013-10-17 13:40:50 -07:00
										 |  |  | import os | 
					
						
							|  |  |  | import sys | 
					
						
							|  |  |  | import unittest | 
					
						
							| 
									
										
										
										
											2013-11-17 17:00:21 -08:00
										 |  |  | from test.support import run_unittest, import_module | 
					
						
							| 
									
										
										
										
											2013-10-17 13:40:50 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-17 17:00:21 -08:00
										 |  |  | # Skip tests if we don't have threading. | 
					
						
							|  |  |  | import_module('threading') | 
					
						
							|  |  |  | # Skip tests if we don't have concurrent.futures. | 
					
						
							|  |  |  | import_module('concurrent.futures') | 
					
						
							| 
									
										
										
										
											2013-10-19 08:47:26 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-17 13:40:50 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | def suite(): | 
					
						
							|  |  |  |     tests = unittest.TestSuite() | 
					
						
							|  |  |  |     loader = unittest.TestLoader() | 
					
						
							| 
									
										
										
										
											2014-03-27 12:21:20 -04:00
										 |  |  |     for fn in os.listdir(os.path.dirname(__file__)): | 
					
						
							|  |  |  |         if fn.startswith("test") and fn.endswith(".py"): | 
					
						
							|  |  |  |             mod_name = 'test.test_asyncio.' + fn[:-3] | 
					
						
							|  |  |  |             try: | 
					
						
							|  |  |  |                 __import__(mod_name) | 
					
						
							|  |  |  |             except unittest.SkipTest: | 
					
						
							|  |  |  |                 pass | 
					
						
							|  |  |  |             else: | 
					
						
							|  |  |  |                 mod = sys.modules[mod_name] | 
					
						
							|  |  |  |                 tests.addTests(loader.loadTestsFromModule(mod)) | 
					
						
							| 
									
										
										
										
											2013-10-17 13:40:50 -07:00
										 |  |  |     return tests | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_main(): | 
					
						
							|  |  |  |     run_unittest(suite()) |