@@ -0,0 +1,1558 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A%22%22%22%0Atest_output_folder%0A------------------%0A%0ATest formerly known from a unittest residing in test_generate.py named%0ATestOutputFolder.test_output_folder%0A%22%22%22%0A%0Afrom __future__ import unicode_literals%0Aimport logging%0Aimport os%0Aimport pytest%0A%0Afrom cookiecutter import generate%0Afrom cookiecutter import utils%0A%0A%0Alogging.basicConfig(format='%25(levelname)s: %25(message)s', level=logging.DEBUG)%0A%0A%0A@pytest.fixture(scope='function')%0Adef remove_output_folder(request):%0A    %22%22%22%0A    Remove the output folder in case it exists on disk.%0A    %22%22%22%0A    def finalizer_remove_output_folder():%0A        if os.path.exists('output_folder'):%0A            utils.rmtree('output_folder')%0A    request.addfinalizer(finalizer_remove_output_folder)%0A%0A%0A@pytest.mark.usefixtures('clean_system', 'remove_output_folder')%0Adef test_output_folder():%0A    context = generate.generate_context(%0A        context_file='tests/test-output-folder/cookiecutter.json'%0A    )%0A    logging.debug('Context is %7B0%7D'.format(context))%0A    generate.generate_files(%0A        context=context,%0A        repo_dir='tests/test-output-folder'%0A    )%0A%0A    something = %22%22%22Hi!%0AMy name is Audrey Greenfeld.%0AIt is 2014.%22%22%22%0A    something2 = open('output_folder/something.txt').read()%0A    assert something == something2%0A%0A    in_folder = %22The color is green and the letter is D.%22%0A    in_folder2 = open('output_folder/folder/in_folder.txt').read()%0A    assert in_folder == in_folder2%0A%0A    assert os.path.isdir('output_folder/im_a.dir')%0A    assert os.path.isfile('output_folder/im_a.dir/im_a.file.py')%0A

Convert test_output_folder using fixture teardown