[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Working on Retro 80s Game SDK, Looking for general support



On Wed, Jan 7, 2009 at 2:00 AM, Patrick Mullen <saluk64007@xxxxxxxxx> wrote:
On Tue, Jan 6, 2009 at 10:59 PM, Jake b <ninmonkeys@xxxxxxxxx> wrote:
through, I use the "assert" statement to make sure that the frame counter is no
longer progressing.  Later, if I change some of the animation code
somewhere that
might mess up the play_3_times behavior, when i run the tests that
test will error,
and I'll know I broke something.

Do you use the assert statement, or do you have a function like this?

def _assert(exp, msg=""):
"""An assert() function.
source: http://www.gamedev.net/community/forums/topic.asp?topic_id=496793"""
if __debug__ and not exp:
import pdb
print "\n_assert failed:\n\t%s\n" % msg # or: simple: print "_assert failed: ", msg
pdb.set_trace()

--
Jake