##// END OF EJS Templates
Create test for %xdel magic. Not passing yet, although the equivalent works in interactive use.
Thomas Kluyver -
Show More
@@ -394,6 +394,22 b' def test_reset_hard():'
394 nt.assert_equal(monitor, [])
394 nt.assert_equal(monitor, [])
395 _ip.magic_reset("-f")
395 _ip.magic_reset("-f")
396 nt.assert_equal(monitor, [1])
396 nt.assert_equal(monitor, [1])
397
398 class TestXdel(tt.TempFileMixin):
399 def test_xdel(self):
400 """Test that references from %run are cleared by xdel."""
401 src = ("class A(object):\n"
402 " monitor = []\n"
403 " def __del__(self):\n"
404 " self.monitor.append(1)\n"
405 "a = A()\n")
406 self.mktmp(src)
407 _ip.magic("run %s" % self.fname)
408 _ip.run_cell("a")
409 monitor = _ip.user_ns["A"].monitor
410 nt.assert_equal(monitor, [])
411 _ip.magic("xdel a")
412 nt.assert_equal(monitor, [1])
397
413
398 def doctest_who():
414 def doctest_who():
399 """doctest for %who
415 """doctest for %who
General Comments 0
You need to be logged in to leave comments. Login now