Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/commands/install_uninstall_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def test_uninstall(tempdir_factory):


def _get_commit_output(tempdir_factory, touch_file='foo', **kwargs):
cmd_output('touch', touch_file)
open(touch_file, 'a').close()
cmd_output('git', 'add', touch_file)
return cmd_output_mocked_pre_commit_home(
'git', 'commit', '-am', 'Commit!', '--allow-empty',
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _make_conflict():
def in_merge_conflict(tempdir_factory):
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
with cwd(path):
cmd_output('touch', 'dummy')
open('dummy', 'a').close()
cmd_output('git', 'add', 'dummy')
cmd_output('git', 'commit', '-m', 'Add config.')

Expand Down
4 changes: 2 additions & 2 deletions tests/make_archives_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ def test_make_archive(tempdir_factory):
git_path = git_dir(tempdir_factory)
# Add a files to the git directory
with cwd(git_path):
cmd_output('touch', 'foo')
open('foo', 'a').close()
cmd_output('git', 'add', '.')
cmd_output('git', 'commit', '-m', 'foo')
# We'll use this sha
head_sha = get_head_sha('.')
# And check that this file doesn't exist
cmd_output('touch', 'bar')
open('bar', 'a').close()
cmd_output('git', 'add', '.')
cmd_output('git', 'commit', '-m', 'bar')

Expand Down
4 changes: 2 additions & 2 deletions tests/store_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def test_store_require_created(store):
# Should create the store directory
assert os.path.exists(store.directory)
# Should create a README file indicating what the directory is about
with io.open(os.path.join(store.directory, 'README'), 'r') as readme_file:
with io.open(os.path.join(store.directory, 'README')) as readme_file:
readme_contents = readme_file.read()
for text_line in (
'This directory is maintained by the pre-commit project.',
Expand All @@ -73,7 +73,7 @@ def test_does_not_recreate_if_directory_already_exists(store):
# Note: we're intentionally leaving out the README file. This is so we can
# know that `Store` didn't call create
os.mkdir(store.directory)
io.open(store.db_path, 'a+').close()
open(store.db_path, 'a').close()
# Call require_created, this should not call create
store.require_created()
assert not os.path.exists(os.path.join(store.directory, 'README'))
Expand Down