From 97c644c189a7415dc489cfb3712209284aea8c60 2011-04-07 18:30:08 From: Thomas Kluyver Date: 2011-04-07 18:30:08 Subject: [PATCH] Add test for hard reset. --- diff --git a/IPython/core/tests/test_magic.py b/IPython/core/tests/test_magic.py index 9328c81..d6b6e8b 100644 --- a/IPython/core/tests/test_magic.py +++ b/IPython/core/tests/test_magic.py @@ -379,6 +379,21 @@ def test_xmode(): for i in range(3): _ip.magic("xmode") nt.assert_equal(_ip.InteractiveTB.mode, xmode) + +def test_reset_hard(): + monitor = [] + class A(object): + def __del__(self): + monitor.append(1) + def __repr__(self): + return "" + + _ip.user_ns["a"] = A() + _ip.run_cell("a") + + nt.assert_equal(monitor, []) + _ip.magic_reset("-hf") + nt.assert_equal(monitor, [1]) def doctest_who(): """doctest for %who