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

Function test_precommit_cli_forwards_quality_config

tests/test_precommit.py:573–588  ·  view source on GitHub ↗
(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)

Source from the content-addressed store, hash-verified

571
572
573def test_precommit_cli_forwards_quality_config(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
574 _write_skill(tmp_path / "skills", "config-skill")
575 (tmp_path / "quality.yaml").write_text("expected_headers: []\n", encoding="utf-8")
576 monkeypatch.chdir(tmp_path)
577 runner = CliRunner()
578 path = "skills/config-skill/SKILL.md"
579
580 default = runner.invoke(cli, ["precommit-run", "quality", "--min-score", "0", path])
581 # pre-commit appends hook args after the entry, then filenames.
582 configured = runner.invoke(
583 cli, ["precommit-run", "quality", "--min-score", "0", "--quality-config", "quality.yaml", path]
584 )
585
586 assert default.exit_code == 0, default.output
587 assert configured.exit_code == 0, configured.output
588 assert _score_from_line(configured.output) > _score_from_line(default.output)
589
590
591def test_precommit_cli_rejects_invalid_quality_config(tmp_path: Path) -> None:

Callers

nothing calls this directly

Calls 3

_score_from_lineFunction · 0.85
invokeMethod · 0.80
_write_skillFunction · 0.70

Tested by

no test coverage detected