MCPcopy Create free account
hub / github.com/OpenSparseLLMs/MoM / run_task_tests

Function run_task_tests

lm-eval-harness/lm_eval/utils.py:312–331  ·  view source on GitHub ↗

Find the package root and run the tests for the given tasks

(task_list: List[str])

Source from the content-addressed store, hash-verified

310
311@positional_deprecated
312def run_task_tests(task_list: List[str]):
313 """
314 Find the package root and run the tests for the given tasks
315 """
316 import pytest
317
318 package_root = find_test_root(start_path=pathlib.Path(__file__))
319 task_string = " or ".join(task_list)
320 args = [
321 f"{package_root}/tests/test_version_stable.py",
322 f"--rootdir={package_root}",
323 "-k",
324 f"{task_string}",
325 ]
326 sys.path.append(str(package_root))
327 pytest_return_val = pytest.main(args)
328 if pytest_return_val:
329 raise ValueError(
330 f"Not all tests for the specified tasks ({task_list}) ran successfully! Error code: {pytest_return_val}"
331 )
332
333
334def get_git_commit_hash():

Callers 1

simple_evaluateFunction · 0.90

Calls 1

find_test_rootFunction · 0.85

Tested by

no test coverage detected