mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 01:51:46 +04:00
upgrade hooks, pyupgrade pre-commit
This commit is contained in:
parent
764c765d29
commit
30c1e8289f
91 changed files with 176 additions and 437 deletions
|
|
@ -1,9 +1,5 @@
|
|||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import contextlib
|
||||
import distutils.spawn
|
||||
import io
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
|
@ -42,8 +38,8 @@ def test_find_executable_not_found_none():
|
|||
def write_executable(shebang, filename='run'):
|
||||
os.mkdir('bin')
|
||||
path = os.path.join('bin', filename)
|
||||
with io.open(path, 'w') as f:
|
||||
f.write('#!{}'.format(shebang))
|
||||
with open(path, 'w') as f:
|
||||
f.write(f'#!{shebang}')
|
||||
make_executable(path)
|
||||
return path
|
||||
|
||||
|
|
@ -106,7 +102,7 @@ def test_normexe_is_a_directory(tmpdir):
|
|||
with pytest.raises(OSError) as excinfo:
|
||||
parse_shebang.normexe(exe)
|
||||
msg, = excinfo.value.args
|
||||
assert msg == 'Executable `{}` is a directory'.format(exe)
|
||||
assert msg == f'Executable `{exe}` is a directory'
|
||||
|
||||
|
||||
def test_normexe_already_full_path():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue