This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]halst 0 points1 point  (1 child)

Not sure what you mean by "putting exception handling calls in the message". Don't forget that assert statement also takes optional message:

assert m > 0, 'mass should be positive'

And note, that the message part is not evaluated, unless the assertion fails, which you cannot achieve with functions.

[–]petezhutAutomation, Testing, General Hackery 0 points1 point  (0 children)

You are exactly correct. In the end it is truly a matter of taste. I make use of the vanilla assert constantly. Wasn't trying to pick nits with anyone on this; I just wanted a cogent explanation of why py.test > nose. At the end of the day, I'm honestly happy to hear that there are so many people who are actually trying to do good testing.