Message158883
| Author |
r.david.murray |
| Recipients |
michael.foord, r.david.murray |
| Date |
2012年04月20日.20:38:08 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1334954289.59.0.991318648825.issue14636@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I just spent an hour figuring out why my test was failing because I tried to do this:
mymock.side_effect = (AuthenticationError, None)
expecting the first call to raise an auth error and the second time it was called to get a normal return.
Since there are almost zero circumstances in which one would really want to return an exception, is there any reason not to have mock check for exceptions and raise them in this circumstance? (If one did need to return an exception one could write a function...which is what one has to do now for the above case, but the above case seems more commonly needed than returning an exception would be.) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年04月20日 20:38:09 | r.david.murray | set | recipients:
+ r.david.murray, michael.foord |
| 2012年04月20日 20:38:09 | r.david.murray | set | messageid: <1334954289.59.0.991318648825.issue14636@psf.upfronthosting.co.za> |
| 2012年04月20日 20:38:09 | r.david.murray | link | issue14636 messages |
| 2012年04月20日 20:38:08 | r.david.murray | create |
|