fix: use logger instead of direct assert
This commit is contained in:
		
							parent
							
								
									2dbfa986fa
								
							
						
					
					
						commit
						7265411abe
					
				|  | @ -13,6 +13,7 @@ from joj3_config_generator.models.const import ( | ||||||
|     JOJ3_CONFIG_ROOT, |     JOJ3_CONFIG_ROOT, | ||||||
| ) | ) | ||||||
| from joj3_config_generator.models.task import Parser as ParserEnum | from joj3_config_generator.models.task import Parser as ParserEnum | ||||||
|  | from joj3_config_generator.utils.logger import logger | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def get_conf_stage( | def get_conf_stage( | ||||||
|  | @ -255,12 +256,12 @@ def get_testcases( | ||||||
| ) -> Set[str]:  # basedir here should be task_conf.root / task_conf.path | ) -> Set[str]:  # basedir here should be task_conf.root / task_conf.path | ||||||
|     testcases = set() |     testcases = set() | ||||||
|     for testcases_path in (task_root / task_path).parent.glob("**/*.in"): |     for testcases_path in (task_root / task_path).parent.glob("**/*.in"): | ||||||
|  |         if not os.path.exists(str(testcases_path).removesuffix(".in") + ".out"): | ||||||
|  |             logger.warning(f"Testcase {testcases_path} has no corresponding .out file") | ||||||
|  |             continue | ||||||
|         testcases.add( |         testcases.add( | ||||||
|             str( |             str( | ||||||
|                 testcases_path.relative_to((task_root / task_path).parent) |                 testcases_path.relative_to((task_root / task_path).parent) | ||||||
|             ).removesuffix(".in") |             ).removesuffix(".in") | ||||||
|         ) |         ) | ||||||
|         assert os.path.exists( |  | ||||||
|             str(testcases_path).removesuffix(".in") + ".out" |  | ||||||
|         ), f"{testcases_path} does not have a corresponding *.out file!" |  | ||||||
|     return testcases |     return testcases | ||||||
|  |  | ||||||
|  | @ -111,11 +111,6 @@ | ||||||
|                                     "src": "/home/tt/.config/joj/diff/case2.in" |                                     "src": "/home/tt/.config/joj/diff/case2.in" | ||||||
|                                 } |                                 } | ||||||
|                             }, |                             }, | ||||||
|                             { |  | ||||||
|                                 "stdin": { |  | ||||||
|                                     "src": "/home/tt/.config/joj/diff/case3.in" |  | ||||||
|                                 } |  | ||||||
|                             }, |  | ||||||
|                             { |                             { | ||||||
|                                 "stdin": { |                                 "stdin": { | ||||||
|                                     "src": "/home/tt/.config/joj/diff/task1/case4.in" |                                     "src": "/home/tt/.config/joj/diff/task1/case4.in" | ||||||
|  | @ -229,18 +224,6 @@ | ||||||
|                                         } |                                         } | ||||||
|                                     ] |                                     ] | ||||||
|                                 }, |                                 }, | ||||||
|                                 { |  | ||||||
|                                     "outputs": [ |  | ||||||
|                                         { |  | ||||||
|                                             "score": 100, |  | ||||||
|                                             "fileName": "stdout", |  | ||||||
|                                             "answerPath": "/home/tt/.config/joj/diff/case3.out", |  | ||||||
|                                             "forceQuitOnDiff": false, |  | ||||||
|                                             "alwaysHide": false, |  | ||||||
|                                             "compareSpace": false |  | ||||||
|                                         } |  | ||||||
|                                     ] |  | ||||||
|                                 }, |  | ||||||
|                                 { |                                 { | ||||||
|                                     "outputs": [ |                                     "outputs": [ | ||||||
|                                         { |                                         { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user