MCPcopy Create free account
hub / github.com/ipython/ipython / test_magic_rerun

Function test_magic_rerun

IPython/core/tests/test_history.py:162–169  ·  view source on GitHub ↗

Simple test for %rerun (no args -> rerun last line)

()

Source from the content-addressed store, hash-verified

160 nt.assert_equal(actual, expected)
161
162def test_magic_rerun():
163 """Simple test for %rerun (no args -> rerun last line)"""
164 ip = get_ipython()
165 ip.run_cell("a = 10", store_history=True)
166 ip.run_cell("a += 1", store_history=True)
167 nt.assert_equal(ip.user_ns["a"], 11)
168 ip.run_cell("%rerun", store_history=True)
169 nt.assert_equal(ip.user_ns["a"], 12)
170
171def test_timestamp_type():
172 ip = get_ipython()

Callers

nothing calls this directly

Calls 2

get_ipythonFunction · 0.50
run_cellMethod · 0.45

Tested by

no test coverage detected