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

Function test_stdout_write_bug_py26

tests/commands/run_test.py:738–754  ·  view source on GitHub ↗
(repo_with_failing_hook, store, tempdir_factory)

Source from the content-addressed store, hash-verified

736
737
738def test_stdout_write_bug_py26(repo_with_failing_hook, store, tempdir_factory):
739 with cwd(repo_with_failing_hook):
740 with modify_config() as config:
741 config['repos'][0]['hooks'][0]['args'] = ['☃']
742 stage_a_file()
743
744 install(C.CONFIG_FILE, store, hook_types=['pre-commit'])
745
746 # Have to use subprocess because pytest monkeypatches sys.stdout
747 _, out = git_commit(
748 fn=cmd_output_mocked_pre_commit_home,
749 tempdir_factory=tempdir_factory,
750 check=False,
751 )
752 assert 'UnicodeEncodeError' not in out
753 # Doesn't actually happen, but a reasonable assertion
754 assert 'UnicodeDecodeError' not in out
755
756
757def test_lots_of_files(store, tempdir_factory):

Callers

nothing calls this directly

Calls 5

cwdFunction · 0.90
modify_configFunction · 0.90
installFunction · 0.90
git_commitFunction · 0.90
stage_a_fileFunction · 0.85

Tested by

no test coverage detected