@contextmanager
def bake_in_temp_dir(cookies, *args, **kwargs):
 result = cookies.bake(*args, **kwargs)
 try:
  (yield result)
 finally:
  rmtree(str(result.project))

@ contextmanager def bake_in_temp_dir ( cookies , * args , ** kwargs ) : result = cookies . bake ( * args , ** kwargs ) try : ( yield result ) finally : rmtree ( str ( result . project ) )
delete the temporal directory that is created when executing the tests .