@pytest.fixture(autouse=True)
def remove_replay_dump(request, replay_file):
 def fin_remove_replay_file():
  if os.path.exists(replay_file):
   os.remove(replay_file)
 request.addfinalizer(fin_remove_replay_file)

@ pytest . fixture ( autouse = True ) def remove_replay_dump ( request , replay_file ) : def fin_remove_replay_file ( ) : if os . path . exists ( replay_file ) : os . remove ( replay_file ) request . addfinalizer ( fin_remove_replay_file )
remove the replay file created by tests .