mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Fix test since pip 10 changed output
This commit is contained in:
parent
3555a2b158
commit
f88e007f52
4 changed files with 18 additions and 48 deletions
|
|
@ -1,7 +1,13 @@
|
|||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
from pre_commit.languages import helpers
|
||||
from pre_commit.prefix import Prefix
|
||||
from pre_commit.util import CalledProcessError
|
||||
|
||||
|
||||
def test_basic_get_default_version():
|
||||
|
|
@ -10,3 +16,15 @@ def test_basic_get_default_version():
|
|||
|
||||
def test_basic_healthy():
|
||||
assert helpers.basic_healthy(None, None) is True
|
||||
|
||||
|
||||
def test_failed_setup_command_does_not_unicode_error():
|
||||
script = (
|
||||
'import sys\n'
|
||||
"getattr(sys.stderr, 'buffer', sys.stderr).write(b'\\x81\\xfe')\n"
|
||||
'exit(1)\n'
|
||||
)
|
||||
|
||||
# an assertion that this does not raise `UnicodeError`
|
||||
with pytest.raises(CalledProcessError):
|
||||
helpers.run_setup_cmd(Prefix('.'), (sys.executable, '-c', script))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue