@dec.skip_without('sqlite3')
def test_macro_run():
 ip = get_ipython()
 ip.history_manager.reset()
 cmds = ['a=10', 'a+=1', py3compat.doctest_refactor_print('print a'), '%macro test 2-3']
 for cmd in cmds:
  ip.run_cell(cmd, store_history=True)
 nt.assert_equal(ip.user_ns['test'].value, py3compat.doctest_refactor_print('a+=1\nprint a\n'))
 with tt.AssertPrints('12'):
  ip.run_cell('test')
 with tt.AssertPrints('13'):
  ip.run_cell('test')

@ dec . skip_without ( 'sqlite3' ) def test_macro_run ( ) : ip = get_ipython ( ) ip . history_manager . reset ( ) cmds = [ 'a=10' , 'a+=1' , py3compat . doctest_refactor_print ( 'print a' ) , '%macro test 2-3' ] for cmd in cmds : ip . run_cell ( cmd , store_history = True ) nt . assert_equal ( ip . user_ns [ 'test' ] . value , py3compat . doctest_refactor_print ( 'a+=1\nprint a\n' ) ) with tt . AssertPrints ( '12' ) : ip . run_cell ( 'test' ) with tt . AssertPrints ( '13' ) : ip . run_cell ( 'test' )
test that we can run a multi-line macro successfully .