print success messages for asserts in python
<p>I am using assert in python. Every time an assert fails I get the failure message which I would have put there to be printed. I was wondering if there is a way to print a custom success message when the assert condition passes?</p>

<p>I am using py.test framework.</p>

<p>for instance: </p>

<pre><code>assert self.clnt.stop_io()==1, "IO stop failed"
</code></pre>

<p>for the above assert I get message "IO stop failed" if assert fails but I am looking to have "IO stop succeeded" if assert passes. something like this:</p>

<pre><code> assert self.clnt.stop_io()==1, "IO stop failed", "IO stop succeeded"
</code></pre>