Clean up directories on failure. Closes #58.

This commit is contained in:
Anthony Sottile 2014-04-03 22:54:27 -07:00
parent 443b62d56a
commit bcb00726a1
8 changed files with 103 additions and 38 deletions

View file

@ -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())]()