| 
									
										
										
										
											2022-12-11 13:15:23 +01:00
										 |  |  | def load_tests(loader, standard_tests, pattern): | 
					
						
							|  |  |  |     import os | 
					
						
							|  |  |  |     import unittest | 
					
						
							| 
									
										
										
										
											2023-10-03 09:47:22 +02:00
										 |  |  |     from .. import file_path | 
					
						
							| 
									
										
										
										
											2022-12-11 13:15:23 +01:00
										 |  |  |     from worlds.AutoWorld import AutoWorldRegister | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     suite = unittest.TestSuite() | 
					
						
							|  |  |  |     suite.addTests(standard_tests) | 
					
						
							|  |  |  |     folders = [os.path.join(os.path.split(world.__file__)[0], "test") | 
					
						
							|  |  |  |                for world in AutoWorldRegister.world_types.values()] | 
					
						
							| 
									
										
										
										
											2023-06-01 01:44:54 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     all_tests = [ | 
					
						
							|  |  |  |         test_case for folder in folders if os.path.exists(folder) | 
					
						
							|  |  |  |         for test_collection in loader.discover(folder, top_level_dir=file_path) | 
					
						
							| 
									
										
										
										
											2025-04-19 08:42:20 -05:00
										 |  |  |         for test_suite in test_collection if isinstance(test_suite, unittest.suite.TestSuite) | 
					
						
							| 
									
										
										
										
											2023-06-01 01:44:54 +02:00
										 |  |  |         for test_case in test_suite | 
					
						
							|  |  |  |     ] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     suite.addTests(sorted(all_tests, key=lambda test: test.__module__)) | 
					
						
							| 
									
										
										
										
											2022-12-11 13:15:23 +01:00
										 |  |  |     return suite |