def raises(exc, func, *args, **kwds):
    """Utility: Make sure the given exception is raised."""
    try:
        func(*args, **kwds)
    except exc:
        return True
    else:
        raise AssertionError('%s did not raise %s' % (func, exc))