MCPcopy Create free account
hub / github.com/NVIDIA/SkillEvaluator / test_precommit_cli_exit_codes

Function test_precommit_cli_exit_codes

tests/test_precommit.py:364–389  ·  view source on GitHub ↗
(tmp_path: Path)

Source from the content-addressed store, hash-verified

362
363
364def test_precommit_cli_exit_codes(tmp_path: Path) -> None:
365 skill = _write_skill(tmp_path, "cli-skill")
366 runner = CliRunner()
367
368 passed = runner.invoke(
369 cli,
370 ["precommit-run", "--min-score", "70", "quality", str(skill / "SKILL.md")],
371 )
372 assert passed.exit_code == 0, passed.output
373 assert "PASS cli-skill quality" in passed.output
374
375 failed = runner.invoke(
376 cli,
377 ["precommit-run", "--min-score", "100", "quality", str(skill / "SKILL.md")],
378 )
379 assert failed.exit_code == 1, failed.output
380 assert "FAIL cli-skill quality" in failed.output
381 assert "(min 100)" in failed.output
382
383 # pre-commit appends hook args after the entry, then filenames.
384 interleaved = runner.invoke(
385 cli,
386 ["precommit-run", "quality", "--min-score", "100", str(skill / "SKILL.md")],
387 )
388 assert interleaved.exit_code == 1, interleaved.output
389 assert "(min 100)" in interleaved.output
390
391
392def test_precommit_cli_maps_relative_paths_from_cwd(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:

Callers

nothing calls this directly

Calls 2

invokeMethod · 0.80
_write_skillFunction · 0.70

Tested by

no test coverage detected