def project_dir():
    """Return test project folder name and remove it after the test."""
    yield 'fake-project-templated'

    if os.path.isdir('fake-project-templated'):
        utils.rmtree('fake-project-templated')
Return test project folder name and remove it after the test.
tests/test_cookiecutter_invocation.py