MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / test_show_diff_on_failure

Function test_show_diff_on_failure

tests/commands/run_test.py:327–346  ·  view source on GitHub ↗
(
        args,
        expected_out,
        capfd,
        cap_out,
        store,
        tempdir_factory,
)

Source from the content-addressed store, hash-verified

325 ],
326)
327def test_show_diff_on_failure(
328 args,
329 expected_out,
330 capfd,
331 cap_out,
332 store,
333 tempdir_factory,
334):
335 git_path = make_consuming_repo(
336 tempdir_factory, 'modified_file_returns_zero_repo',
337 )
338 with cwd(git_path):
339 stage_a_file('bar.py')
340 _test_run(
341 cap_out, store, git_path, args,
342 # we're only testing the output after running
343 expected_out, 1, True,
344 )
345 out, _ = capfd.readouterr()
346 assert 'diff --git' in out
347
348
349@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 4

make_consuming_repoFunction · 0.90
cwdFunction · 0.90
stage_a_fileFunction · 0.85
_test_runFunction · 0.85

Tested by

no test coverage detected