Careful: this will NOT work. You are using the event_tuples variable in case of success and error. It will bomb if the exception is caught. I've seen this in other places too. Make sure event_tuples is initialized to an empty list before

A unit test doing branch coverage would catch this.