From 2a50373311d54d231652727735aebd7873da9e80 Mon Sep 17 00:00:00 2001 From: wassname <1103714+wassname@users.noreply.github.com> Date: Fri, 19 Jun 2026 08:47:41 +0800 Subject: [PATCH] test: put scripts/ on sys.path so benchmark's sibling _cost import resolves in CI CI collection failed with ModuleNotFoundError: No module named '_cost' because exec_module loads the script without its dir on sys.path. Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com> --- tests/test_metamath_gsm8k_benchmark.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_metamath_gsm8k_benchmark.py b/tests/test_metamath_gsm8k_benchmark.py index 91f5241..89f6840 100644 --- a/tests/test_metamath_gsm8k_benchmark.py +++ b/tests/test_metamath_gsm8k_benchmark.py @@ -4,6 +4,8 @@ from pathlib import Path SCRIPT_PATH = Path(__file__).parents[1] / "scripts" / "metamath_gsm8k_benchmark.py" +# the script uses sibling imports (`from _cost import ...`), so scripts/ must be importable +sys.path.insert(0, str(SCRIPT_PATH.parent)) SPEC = importlib.util.spec_from_file_location("metamath_gsm8k_benchmark", SCRIPT_PATH) benchmark = importlib.util.module_from_spec(SPEC) assert SPEC.loader is not None