class DeferredAsserter(object):

    def __init__(self):
        self.broken = False

def assert_equal(self, expected, actual):
    outstr = '%s == %s...' % (expected, actual)
raw_print(outstr)
try:
    assert expected == actual
except AssertionError:
    raw_print('FAILED\n\n')
self.broken = True
Python test framework with support of non-fatal failures