mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-06 12:06:53 +00:00
pre-commit-hooks: python3.6+
This commit is contained in:
parent
551d1a07b3
commit
f5c42a050b
60 changed files with 291 additions and 493 deletions
|
|
@ -1,6 +1,3 @@
|
|||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import io
|
||||
|
||||
import pytest
|
||||
|
|
@ -129,9 +126,6 @@ def test_not_ok_input_alternate_pragma():
|
|||
@pytest.mark.parametrize(
|
||||
('input_s', 'expected'),
|
||||
(
|
||||
# Python 2 cli parameters are bytes
|
||||
(b'# coding: utf-8', b'# coding: utf-8'),
|
||||
# Python 3 cli parameters are text
|
||||
('# coding: utf-8', b'# coding: utf-8'),
|
||||
# trailing whitespace
|
||||
('# coding: utf-8\n', b'# coding: utf-8'),
|
||||
|
|
@ -149,7 +143,7 @@ def test_integration_alternate_pragma(tmpdir, capsys):
|
|||
assert main((f.strpath, '--pragma', pragma)) == 1
|
||||
assert f.read() == '# coding: utf-8\nx = 1\n'
|
||||
out, _ = capsys.readouterr()
|
||||
assert out == 'Added `# coding: utf-8` to {}\n'.format(f.strpath)
|
||||
assert out == f'Added `# coding: utf-8` to {f.strpath}\n'
|
||||
|
||||
|
||||
def test_crlf_ok(tmpdir):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue