def _do_inline(func, **kwargs): for dec in ( begin_rewrite(), debug(**kwargs), if_inline(), debug(**kwargs), end_rewrite()): func = dec(func) return func
def _do_ssa(func, strict, **kwargs): for dec in ( begin_rewrite(), debug(**kwargs), ssa(strict), debug(**kwargs), end_rewrite()): func = dec(func) return func
def test_debug_error(): with pytest.raises(Exception, match=r"Cannot dump source filename without .*"): @apply_cst_passes([debug(dump_source_filename=True)]) def foo(): print("bar") with pytest.raises(Exception, match=r"Cannot dump source lines without .*"): @apply_cst_passes([debug(dump_source_lines=True)]) def foo(): print("bar")