Remove py26 format literals

Resolves #403
This commit is contained in:
Anthony Sottile 2016-09-15 08:17:18 -07:00
parent 26e60fa333
commit b81c9802ae
28 changed files with 58 additions and 58 deletions

View file

@ -186,7 +186,7 @@ def test_does_not_contain_defaults():
if isinstance(schema, dict):
if 'default' in schema:
raise AssertionError(
'Unexpected default in schema at {0}'.format(
'Unexpected default in schema at {}'.format(
' => '.join(route),
)
)

View file

@ -12,7 +12,7 @@ from pre_commit.color import use_color
@pytest.mark.parametrize(('in_text', 'in_color', 'in_use_color', 'expected'), (
('foo', GREEN, True, '{0}foo\033[0m'.format(GREEN)),
('foo', GREEN, True, '{}foo\033[0m'.format(GREEN)),
('foo', GREEN, False, 'foo'),
))
def test_format_color(in_text, in_color, in_use_color, expected):

View file

@ -417,7 +417,7 @@ def test_lots_of_files(mock_out_store_directory, tempdir_factory):
# Write a crap ton of files
for i in range(400):
filename = '{0}{1}'.format('a' * 100, i)
filename = '{}{}'.format('a' * 100, i)
open(filename, 'w').close()
cmd_output('bash', '-c', 'git add .')

View file

@ -10,7 +10,7 @@ def test_norm_version_expanduser():
home = os.path.expanduser('~')
if os.name == 'nt': # pragma: no cover (nt)
path = r'~\python343'
expected_path = r'{0}\python343'.format(home)
expected_path = r'{}\python343'.format(home)
else: # pragma: no cover (non-nt)
path = '~/.pyenv/versions/3.4.3/bin/python'
expected_path = home + '/.pyenv/versions/3.4.3/bin/python'

View file

@ -69,7 +69,7 @@ def write_executable(shebang, filename='run'):
os.mkdir('bin')
path = os.path.join('bin', filename)
with io.open(path, 'w') as f:
f.write('#!{0}'.format(shebang))
f.write('#!{}'.format(shebang))
make_executable(path)
return path

View file

@ -293,7 +293,7 @@ def _norm_pwd(path):
# Under windows bash's temp and windows temp is different.
# This normalizes to the bash /tmp
return cmd_output(
'bash', '-c', "cd '{0}' && pwd".format(path),
'bash', '-c', "cd '{}' && pwd".format(path),
encoding=None,
)[1].strip()
@ -554,7 +554,7 @@ def test_hook_id_not_present(tempdir_factory, store, fake_log_handler):
with pytest.raises(SystemExit):
repo.install()
assert fake_log_handler.handle.call_args[0][0].msg == (
'`i-dont-exist` is not present in repository {0}. '
'`i-dont-exist` is not present in repository {}. '
'Typo? Perhaps it is introduced in a newer version? '
'Often you can fix this by removing the hook, '
'running `pre-commit autoupdate`, '