unit testing - print success messages for asserts in python -


i using assert in python. every time assert fails failure message have put there printed. wondering if there way print custom success message when assert condition passes ? using py.test framework.

example:

assert self.clnt.stop_io()==1, "io stop failed" 

for above assert message "io stop failed" if assert fails looking have "io stop succeeded" if assert passes. like

 assert self.clnt.stop_io()==1, "io stop failed", "io stop succeeded" 

yes, simplest surely place print below assert:

assert self.clnt.stop_io()==1, "io stop failed" print("io stop passed @ location ==1") 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -