Make Exceptions and testing thereof more Pythonic