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

Function test_reset_out

IPython/core/tests/test_magic.py:339–347  ·  view source on GitHub ↗

Test '%reset out' magic

()

Source from the content-addressed store, hash-verified

337 nt.assert_not_in('a', _ip.user_ns)
338
339def test_reset_out():
340 "Test '%reset out' magic"
341 _ip.run_cell("parrot = 'dead'", store_history=True)
342 # test '%reset -f out', make an Out prompt
343 _ip.run_cell("parrot", store_history=True)
344 nt.assert_true('dead' in [_ip.user_ns[x] for x in ('_','__','___')])
345 _ip.magic('reset -f out')
346 nt.assert_false('dead' in [_ip.user_ns[x] for x in ('_','__','___')])
347 nt.assert_equal(len(_ip.user_ns['Out']), 0)
348
349def test_reset_in():
350 "Test '%reset in' magic"

Callers

nothing calls this directly

Calls 2

run_cellMethod · 0.45
magicMethod · 0.45

Tested by

no test coverage detected