def raises(exctype, func, *args, **kwargs):
try:<EOL><INDENT>func(*args, **kwargs)<EOL><DEDENT>except exctype:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>func_name = getattr(func, "<STR_LIT>", "<STR_LIT>")<EOL>raise AssertionError("<STR_LIT>" % (<EOL>func_name, exctype.__name__))<EOL><DEDENT>
comments