summaryrefslogtreecommitdiffstats
path: root/tests/error_handler_test.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-04 07:22:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-04 07:22:18 +0000
commit58a809aa43ae21566be4613eb42ac56faf54f901 (patch)
tree371b9cc8a265cbabea4b12e5508b8bde6edf0b89 /tests/error_handler_test.py
parentAdding upstream version 2.20.0. (diff)
downloadpre-commit-58a809aa43ae21566be4613eb42ac56faf54f901.tar.xz
pre-commit-58a809aa43ae21566be4613eb42ac56faf54f901.zip
Adding upstream version 2.21.0.upstream/2.21.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/error_handler_test.py')
-rw-r--r--tests/error_handler_test.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/error_handler_test.py b/tests/error_handler_test.py
index 47e2afa..a79d9c1 100644
--- a/tests/error_handler_test.py
+++ b/tests/error_handler_test.py
@@ -162,7 +162,7 @@ def test_error_handler_non_ascii_exception(mock_store_dir):
def test_error_handler_non_utf8_exception(mock_store_dir):
with pytest.raises(SystemExit):
with error_handler.error_handler():
- raise CalledProcessError(1, ('exe',), 0, b'error: \xa0\xe1', b'')
+ raise CalledProcessError(1, ('exe',), b'error: \xa0\xe1', b'')
def test_error_handler_non_stringable_exception(mock_store_dir):
@@ -183,10 +183,11 @@ def test_error_handler_no_tty(tempdir_factory):
'from pre_commit.error_handler import error_handler\n'
'with error_handler():\n'
' raise ValueError("\\u2603")\n',
- retcode=3,
+ check=False,
tempdir_factory=tempdir_factory,
pre_commit_home=pre_commit_home,
)
+ assert ret == 3
log_file = os.path.join(pre_commit_home, 'pre-commit.log')
out_lines = out.splitlines()
assert out_lines[-2] == 'An unexpected error has occurred: ValueError: ☃'