fix: use logger instead of direct assert
All checks were successful
build / build (push) Successful in 1m39s
build / build (pull_request) Successful in 1m50s

This commit is contained in:
李衍志523370910113 2025-05-23 20:39:12 +08:00
parent 2dbfa986fa
commit 7265411abe
3 changed files with 4 additions and 20 deletions

View File

@ -13,6 +13,7 @@ from joj3_config_generator.models.const import (
JOJ3_CONFIG_ROOT,
)
from joj3_config_generator.models.task import Parser as ParserEnum
from joj3_config_generator.utils.logger import logger
def get_conf_stage(
@ -255,12 +256,12 @@ def get_testcases(
) -> Set[str]: # basedir here should be task_conf.root / task_conf.path
testcases = set()
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(
str(
testcases_path.relative_to((task_root / task_path).parent)
).removesuffix(".in")
)
assert os.path.exists(
str(testcases_path).removesuffix(".in") + ".out"
), f"{testcases_path} does not have a corresponding *.out file!"
return testcases

View File

@ -111,11 +111,6 @@
"src": "/home/tt/.config/joj/diff/case2.in"
}
},
{
"stdin": {
"src": "/home/tt/.config/joj/diff/case3.in"
}
},
{
"stdin": {
"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": [
{