You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
self.assertThat(
lambda: client.add_key_for_owner(user_two, fingerprint),
raises(GPGServiceException("Fingerprint already in the database.")))
However, if there's a bug in my code and the function in question raises a different exception, I get the following output:
MismatchError: <type 'exceptions.NameError'> is not a <class 'lp.services.gpg.interfaces.GPGServiceException'>
At this point I usually change the test to run the function outside of an assertion so I get a proper traceback that allows me to debug the problem. It would be nice if the raises matcher gave me more verbose information about what was raised - at a minimum str(exception).
The text was updated successfully, but these errors were encountered:
Yeah, I agree that this would be a better behaviour. ISTR @rbtcollins suggesting that the current behaviour is a feature, not a bug. Rob, want to chime in?
I often write test code like so:
However, if there's a bug in my code and the function in question raises a different exception, I get the following output:
At this point I usually change the test to run the function outside of an assertion so I get a proper traceback that allows me to debug the problem. It would be nice if the raises matcher gave me more verbose information about what was raised - at a minimum
str(exception)
.The text was updated successfully, but these errors were encountered: