mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 00:54:42 +04:00
Fix for cases where commands output UTF8 in Windows.
This commit is contained in:
parent
2bffc0ad85
commit
54b2d982f3
2 changed files with 19 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||
import os.path
|
||||
import stat
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
|
|
@ -106,3 +107,12 @@ def test_rmtree_read_only_directories(tmpdir):
|
|||
tmpdir.join('x/y/z').chmod(mode_no_w)
|
||||
tmpdir.join('x/y/z').chmod(mode_no_w)
|
||||
rmtree(str(tmpdir.join('x')))
|
||||
|
||||
|
||||
@pytest.mark.parametrize('fn', (cmd_output_b, cmd_output_p))
|
||||
def test_cmd_output_utf8(fn):
|
||||
"""Makes sure `cmd_output_*` works if the command being
|
||||
run outputs UTF8 characters."""
|
||||
ret, out, _ = fn(f'{sys.executable}', '-c', 'print("❤")')
|
||||
assert ret == 0
|
||||
assert out.strip().decode() == '❤'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue