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

Function test_reset_dhist

IPython/core/tests/test_magic.py:358–366  ·  view source on GitHub ↗

Test '%reset dhist' magic

()

Source from the content-addressed store, hash-verified

356 nt.assert_equal(len(set(_ip.user_ns['In'])), 1)
357
358def test_reset_dhist():
359 "Test '%reset dhist' magic"
360 _ip.run_cell("tmp = [d for d in _dh]") # copy before clearing
361 _ip.magic('cd ' + os.path.dirname(nt.__file__))
362 _ip.magic('cd -')
363 nt.assert_true(len(_ip.user_ns['_dh']) > 0)
364 _ip.magic('reset -f dhist')
365 nt.assert_equal(len(_ip.user_ns['_dh']), 0)
366 _ip.run_cell("_dh = [d for d in tmp]") #restore
367
368def test_reset_in_length():
369 "Test that '%reset in' preserves In[] length"

Callers

nothing calls this directly

Calls 2

run_cellMethod · 0.45
magicMethod · 0.45

Tested by

no test coverage detected