MCPcopy
hub / github.com/pre-commit/pre-commit / _test_hook_repo

Function _test_hook_repo

tests/repository_test.py:64–80  ·  view source on GitHub ↗
(
        tempdir_factory,
        store,
        repo_path,
        hook_id,
        args,
        expected,
        expected_return_code=0,
        config_kwargs=None,
        color=False,
)

Source from the content-addressed store, hash-verified

62
63
64def _test_hook_repo(
65 tempdir_factory,
66 store,
67 repo_path,
68 hook_id,
69 args,
70 expected,
71 expected_return_code=0,
72 config_kwargs=None,
73 color=False,
74):
75 path = make_repo(tempdir_factory, repo_path)
76 config = make_config_from_repo(path, **(config_kwargs or {}))
77 hook = _get_hook(config, store, hook_id)
78 ret, out = _hook_run(hook, args, color=color)
79 assert ret == expected_return_code
80 assert out == expected
81
82
83def test_missing_executable(tempdir_factory, store):

Callers 8

test_missing_executableFunction · 0.85
test_run_a_script_hookFunction · 0.85
test_output_isattyFunction · 0.85
test_cwd_of_hookFunction · 0.85
test_lots_of_filesFunction · 0.85

Calls 4

make_repoFunction · 0.90
make_config_from_repoFunction · 0.90
_get_hookFunction · 0.85
_hook_runFunction · 0.85

Tested by

no test coverage detected