@pytest.fixture(scope='function')
def remove_additional_dirs(request):
 def fin_remove_additional_dirs():
  if os.path.isdir('fake-project'):
   utils.rmtree('fake-project')
  if os.path.isdir('fake-project-extra'):
   utils.rmtree('fake-project-extra')
  if os.path.isdir('fake-project-templated'):
   utils.rmtree('fake-project-templated')
  if os.path.isdir('fake-project-dict'):
   utils.rmtree('fake-project-dict')
 request.addfinalizer(fin_remove_additional_dirs)

@ pytest . fixture ( scope = 'function' ) def remove_additional_dirs ( request ) : def fin_remove_additional_dirs ( ) : if os . path . isdir ( 'fake-project' ) : utils . rmtree ( 'fake-project' ) if os . path . isdir ( 'fake-project-extra' ) : utils . rmtree ( 'fake-project-extra' ) if os . path . isdir ( 'fake-project-templated' ) : utils . rmtree ( 'fake-project-templated' ) if os . path . isdir ( 'fake-project-dict' ) : utils . rmtree ( 'fake-project-dict' ) request . addfinalizer ( fin_remove_additional_dirs )
remove special directories which are created during the tests .