@pytest.fixture(scope=u'function')
def remove_cheese_file(request):
 def fin_remove_cheese_file():
  if os.path.exists(u'tests/files/cheese.txt'):
   os.remove(u'tests/files/cheese.txt')
 request.addfinalizer(fin_remove_cheese_file)

@ pytest . fixture ( scope = u'function' ) def remove_cheese_file ( request ) : def fin_remove_cheese_file ( ) : if os . path . exists ( u'tests/files/cheese.txt' ) : os . remove ( u'tests/files/cheese.txt' ) request . addfinalizer ( fin_remove_cheese_file )
remove the cheese text file which is created by the tests .