Normalize crlf in tests

This commit is contained in:
Anthony Sottile
2019-12-23 18:27:30 -08:00
parent 517c3145f4
commit 4941ed58d5
7 changed files with 46 additions and 58 deletions

View File

@@ -144,7 +144,7 @@ def test_error_handler_non_ascii_exception(mock_store_dir):
def test_error_handler_no_tty(tempdir_factory):
pre_commit_home = tempdir_factory.get()
output = cmd_output_mocked_pre_commit_home(
ret, out, _ = cmd_output_mocked_pre_commit_home(
sys.executable,
'-c',
'from __future__ import unicode_literals\n'
@@ -156,8 +156,6 @@ def test_error_handler_no_tty(tempdir_factory):
pre_commit_home=pre_commit_home,
)
log_file = os.path.join(pre_commit_home, 'pre-commit.log')
output_lines = output[1].replace('\r', '').splitlines()
assert (
output_lines[-2] == 'An unexpected error has occurred: ValueError: ☃'
)
assert output_lines[-1] == 'Check the log at {}'.format(log_file)
out_lines = out.splitlines()
assert out_lines[-2] == 'An unexpected error has occurred: ValueError: ☃'
assert out_lines[-1] == 'Check the log at {}'.format(log_file)