Exception handling for Server.run and py.tests