Add test base class
Python 3 compatible exceptions