from __future__ import with_statement
def __init__(self, s):
''' make a new test '''
self.s = s
self.status = None
def __enter__(self, *stuff):
''' return self for use in with statement '''
def __exit__(self, type, value, traceback):
''' print test status '''
def should_be_equal(self, a, b):
self.status = (a == b)
def should_not_be_equal(self, a, b):
self.status = (a != b)
with It('passes') as test:
with It('also passes') as test:
with It('does not pass') as test:
with It('also does not pass') as test: