copier/tests/conftest.py
Juan-Pablo Scaletti e00a3dc466 voodo_setup
2015-03-26 20:55:50 -05:00

16 lines
356 B
Python

# coding=utf-8
from tempfile import mkdtemp
import shutil
import pytest
@pytest.fixture()
def dst(request):
"""Return a real temporary folder path which is unique to each test
function invocation. This folder is deleted after the test has finished.
"""
dst = mkdtemp()
request.addfinalizer(lambda: shutil.rmtree(dst))
return dst