Show More
@@ -395,6 +395,22 b' def test_reset_hard():' | |||||
395 | _ip.magic_reset("-f") |
|
395 | _ip.magic_reset("-f") | |
396 | nt.assert_equal(monitor, [1]) |
|
396 | nt.assert_equal(monitor, [1]) | |
397 |
|
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]) | |||
|
413 | ||||
398 | def doctest_who(): |
|
414 | def doctest_who(): | |
399 | """doctest for %who |
|
415 | """doctest for %who | |
400 |
|
416 |
General Comments 0
You need to be logged in to leave comments.
Login now