Open gjb1002 opened 5 years ago
In total responsible for 8 failing TextTest self-tests, including 3 that hang under ec2cloud.
Basic problem is the situation when you have two levels of exception in the intercepted module.
class MyBaseException(RuntimeError):
pass
class MyDerivedException(MyBaseException):
pass
Capturemock represents this as
<-PYT:raise MyDerivedException(MyBaseException, RuntimeError)("error msg")
but this leads to a multiple inheritance situation and crucially MyBaseException ends up not being derived from RuntimeError, meaning if the code catches it failure will result.
Perhaps it needs to say
<-PYT:raise MyDerivedException(MyBaseException(RuntimeError))("error msg")
but my attempts to make that work with name handlers etc didn't work so well.
All failing self-tests have either been worked around or disabled though (not all were this issue in the end, in some cases exceptions had just been renamed).
In any case this is no longer critical there.
The main reason is that Python 3 does not allow catching exceptions that don't inherit from BaseException. In Python 2 you could catch anything at all.
This caused the failure of TextTest self-tests NoSuchUser and NoSuchSender. Have fixed these for now by hacking in the mock file, should be reverted when this is fixed.