In Python 3, just as in Python 2, the expected exception argument to assertRaises() and assertRaisesRegex() must be a subtype of BaseException, not just of Exception. Closes #2593