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

Function test_during_commit_all

tests/languages/golang_test.py:147–169  ·  view source on GitHub ↗
(tmp_path, tempdir_factory, store, in_git_dir)

Source from the content-addressed store, hash-verified

145
146
147def test_during_commit_all(tmp_path, tempdir_factory, store, in_git_dir):
148 hook_dir = tmp_path.joinpath('hook')
149 hook_dir.mkdir()
150 _make_hello_world(hook_dir)
151 hook_dir.joinpath('.pre-commit-hooks.yaml').write_text(
152 '- id: hello-world\n'
153 ' name: hello world\n'
154 ' entry: golang-hello-world\n'
155 ' language: golang\n'
156 ' always_run: true\n',
157 )
158 cmd_output('git', 'init', hook_dir)
159 cmd_output('git', 'add', '.', cwd=hook_dir)
160 git_commit(cwd=hook_dir)
161
162 add_config_to_repo(in_git_dir, make_config_from_repo(hook_dir))
163
164 assert not install(C.CONFIG_FILE, store, hook_types=['pre-commit'])
165
166 git_commit(
167 fn=cmd_output_mocked_pre_commit_home,
168 tempdir_factory=tempdir_factory,
169 )
170
171
172def test_automatic_toolchain_switching(tmp_path):

Callers

nothing calls this directly

Calls 6

cmd_outputFunction · 0.90
git_commitFunction · 0.90
add_config_to_repoFunction · 0.90
make_config_from_repoFunction · 0.90
installFunction · 0.90
_make_hello_worldFunction · 0.70

Tested by

no test coverage detected