def test_magic_rerun():
 ip = get_ipython()
 ip.run_cell('a = 10', store_history=True)
 ip.run_cell('a += 1', store_history=True)
 nt.assert_equal(ip.user_ns['a'], 11)
 ip.run_cell('%rerun', store_history=True)
 nt.assert_equal(ip.user_ns['a'], 12)

def test_magic_rerun ( ) : ip = get_ipython ( ) ip . run_cell ( 'a = 10' , store_history = True ) ip . run_cell ( 'a += 1' , store_history = True ) nt . assert_equal ( ip . user_ns [ 'a' ] , 11 ) ip . run_cell ( '%rerun' , store_history = True ) nt . assert_equal ( ip . user_ns [ 'a' ] , 12 )
simple test for %rerun .