mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 00:54:42 +04:00
Use plumbum a bit better.
This commit is contained in:
parent
92aa55f44e
commit
7b1230df27
9 changed files with 44 additions and 44 deletions
|
|
@ -75,7 +75,7 @@ def out_of_date_repo(python_hooks_repo):
|
|||
config_wrapped = apply_defaults([config], CONFIG_JSON_SCHEMA)
|
||||
validate_config_extra(config_wrapped)
|
||||
config = config_wrapped[0]
|
||||
local['git']['commit', '--allow-empty', '-m', 'foo']()
|
||||
local['git']('commit', '--allow-empty', '-m', 'foo')
|
||||
head_sha = get_head_sha(python_hooks_repo)
|
||||
|
||||
with open(os.path.join(python_hooks_repo, C.CONFIG_FILE), 'w') as file_obj:
|
||||
|
|
@ -125,8 +125,8 @@ def hook_disappearing_repo(python_hooks_repo):
|
|||
get_resource_path('manifest_without_foo.yaml'),
|
||||
C.MANIFEST_FILE,
|
||||
)
|
||||
local['git']['add', '.']()
|
||||
local['git']['commit', '-m', 'Remove foo']()
|
||||
local['git']('add', '.')
|
||||
local['git']('commit', '-m', 'Remove foo')
|
||||
|
||||
with open(os.path.join(python_hooks_repo, C.CONFIG_FILE), 'w') as file_obj:
|
||||
file_obj.write(
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ from testing.auto_namedtuple import auto_namedtuple
|
|||
|
||||
|
||||
def stage_a_file():
|
||||
local['touch']['foo.py']()
|
||||
local['git']['add', 'foo.py']()
|
||||
local['touch']('foo.py')
|
||||
local['git']('add', 'foo.py')
|
||||
|
||||
|
||||
def get_write_mock_output(write_mock):
|
||||
|
|
@ -153,7 +153,7 @@ def test_merge_conflict_modified(in_merge_conflict, mock_out_store_directory):
|
|||
|
||||
|
||||
def test_merge_conflict_resolved(in_merge_conflict, mock_out_store_directory):
|
||||
local['git']['add', '.']()
|
||||
local['git']('add', '.')
|
||||
ret, printed = _do_run(in_merge_conflict, _get_opts())
|
||||
for msg in ('Checking merge-conflict files only.', 'Bash hook', 'Passed'):
|
||||
assert msg in printed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue