Catch signals during unit tests