mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Replace five with six
This commit is contained in:
parent
cb8dd335f4
commit
c65a11ce3d
9 changed files with 27 additions and 57 deletions
|
|
@ -8,9 +8,9 @@ import os.path
|
|||
|
||||
import mock
|
||||
import pytest
|
||||
import six
|
||||
|
||||
import pre_commit.constants as C
|
||||
from pre_commit import five
|
||||
from pre_commit import output
|
||||
from pre_commit.logging_handler import add_logging_handler
|
||||
from pre_commit.prefixed_command_runner import PrefixedCommandRunner
|
||||
|
|
@ -29,7 +29,7 @@ def tempdir_factory(tmpdir):
|
|||
self.tmpdir_count = 0
|
||||
|
||||
def get(self):
|
||||
path = tmpdir.join(five.text(self.tmpdir_count)).strpath
|
||||
path = tmpdir.join(six.text_type(self.tmpdir_count)).strpath
|
||||
self.tmpdir_count += 1
|
||||
os.mkdir(path)
|
||||
return path
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import subprocess
|
|||
import mock
|
||||
import pytest
|
||||
|
||||
from pre_commit import five
|
||||
from pre_commit.prefixed_command_runner import PrefixedCommandRunner
|
||||
from pre_commit.util import CalledProcessError
|
||||
|
||||
|
|
@ -17,10 +16,7 @@ def norm_slash(input_tup):
|
|||
|
||||
def test_CalledProcessError_str():
|
||||
error = CalledProcessError(
|
||||
1,
|
||||
[five.n('git'), five.n('status')],
|
||||
0,
|
||||
(five.n('stdout'), five.n('stderr')),
|
||||
1, [str('git'), str('status')], 0, (str('stdout'), str('stderr')),
|
||||
)
|
||||
assert str(error) == (
|
||||
"Command: ['git', 'status']\n"
|
||||
|
|
@ -35,7 +31,7 @@ def test_CalledProcessError_str():
|
|||
|
||||
def test_CalledProcessError_str_nooutput():
|
||||
error = CalledProcessError(
|
||||
1, [five.n('git'), five.n('status')], 0, (five.n(''), five.n(''))
|
||||
1, [str('git'), str('status')], 0, (str(''), str(''))
|
||||
)
|
||||
assert str(error) == (
|
||||
"Command: ['git', 'status']\n"
|
||||
|
|
@ -78,7 +74,7 @@ def test_run_substitutes_prefix(popen_mock, makedirs_mock):
|
|||
)
|
||||
ret = instance.run(['{prefix}bar', 'baz'], retcode=None)
|
||||
popen_mock.assert_called_once_with(
|
||||
(five.n(os.path.join('prefix', 'bar')), five.n('baz')),
|
||||
(str(os.path.join('prefix', 'bar')), str('baz')),
|
||||
env=None,
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ import sqlite3
|
|||
|
||||
import mock
|
||||
import pytest
|
||||
import six
|
||||
|
||||
from pre_commit import five
|
||||
from pre_commit.store import _get_default_directory
|
||||
from pre_commit.store import Store
|
||||
from pre_commit.util import cmd_output
|
||||
|
|
@ -116,7 +116,7 @@ def test_clone_cleans_up_on_checkout_failure(store):
|
|||
# doesn't exist!
|
||||
store.clone('/i_dont_exist_lol', 'fake_sha')
|
||||
except Exception as e:
|
||||
assert '/i_dont_exist_lol' in five.text(e)
|
||||
assert '/i_dont_exist_lol' in six.text_type(e)
|
||||
|
||||
things_starting_with_repo = [
|
||||
thing for thing in os.listdir(store.directory)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue