mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Clean up directories on failure. Closes #58.
This commit is contained in:
parent
443b62d56a
commit
bcb00726a1
8 changed files with 103 additions and 38 deletions
|
|
@ -13,12 +13,17 @@ from testing.util import get_resource_path
|
|||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def empty_git_dir(tmpdir):
|
||||
def in_tmpdir(tmpdir):
|
||||
with local.cwd(tmpdir.strpath):
|
||||
local['git']['init']()
|
||||
yield tmpdir.strpath
|
||||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def empty_git_dir(in_tmpdir):
|
||||
local['git']['init']()
|
||||
yield in_tmpdir
|
||||
|
||||
|
||||
def add_and_commit():
|
||||
local['git']['add', '.']()
|
||||
local['git']['commit', '-m', 'random commit {0}'.format(time.time())]()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue