<s> import __builtin__ as bltin <EOL> import py <EOL> import inspect <EOL> def check_assertion ( ) : <EOL> excinfo = py . test . raises ( AssertionError , "<STR_LIT>" ) <EOL> assert excinfo . exconly ( tryshort = True ) == "<STR_LIT>" <EOL> def test_invoke_assertion ( ) : <EOL> py . magic . invoke ( assertion = True ) <EOL> try : <EOL> check_assertion ( ) <EOL> finally : <EOL> py . magic . revoke ( assertion = True ) <EOL> def test_invoke_compile ( ) : <EOL> py . magic . invoke ( compile = True ) <EOL> try : <EOL> co = compile ( """<STR_LIT>""" , '<STR_LIT>' , '<STR_LIT>' ) <EOL> d = { } <EOL> exec co in d <EOL> assert py . code . Source ( d [ '<STR_LIT:f>' ] ) <EOL> finally : <EOL> py . magic . revoke ( compile = True ) </s>
