diff --git a/IPython/core/tests/test_magic.py b/IPython/core/tests/test_magic.py index 8963705..32d7ca7 100644 --- a/IPython/core/tests/test_magic.py +++ b/IPython/core/tests/test_magic.py @@ -727,6 +727,21 @@ def test_debug_magic(): In [2]: """ +def test_debug_magic_locals(): + """Test debugging a small code with %debug with locals + + In [1]: with PdbTestInput(['c']): + ...: def fun(): + ...: res = 1 + ...: %debug print(res) + ...: fun() + ...: + ... + ipdb> c + 1 + In [2]: + """ + def test_psearch(): with tt.AssertPrints("dict.fromkeys"): _ip.run_cell("dict.fr*?")