From d5bd4f46b3c1ed55b95254f22679e1122e8055ca 2016-01-18 13:50:53 From: Min RK Date: 2016-01-18 13:50:53 Subject: [PATCH] Merge pull request #9076 from Carreau/test_debugger Write tests for ipdb --- diff --git a/IPython/core/tests/test_debugger.py b/IPython/core/tests/test_debugger.py index 7b193d5..9e11d93 100644 --- a/IPython/core/tests/test_debugger.py +++ b/IPython/core/tests/test_debugger.py @@ -100,7 +100,11 @@ def test_ipdb_magics(): >>> with PdbTestInput([ ... 'pdef example_function', ... 'pdoc ExampleClass', + ... 'up', + ... 'down', + ... 'list', ... 'pinfo a', + ... 'll', ... 'continue', ... ]): ... trigger_ipdb() @@ -118,12 +122,35 @@ def test_ipdb_magics(): Docstring for ExampleClass. Init docstring: Docstring for ExampleClass.__init__ + ipdb> up + > (11)() + 9 'continue', + 10 ]): + ---> 11 trigger_ipdb() + + ipdb> down + None + > (3)trigger_ipdb() + 1 def trigger_ipdb(): + 2 a = ExampleClass() + ----> 3 debugger.Pdb().set_trace() + + ipdb> list + 1 def trigger_ipdb(): + 2 a = ExampleClass() + ----> 3 debugger.Pdb().set_trace() + ipdb> pinfo a Type: ExampleClass String form: ExampleClass() Namespace: Local... Docstring: Docstring for ExampleClass. Init docstring: Docstring for ExampleClass.__init__ + ipdb> ll + 1 def trigger_ipdb(): + 2 a = ExampleClass() + ----> 3 debugger.Pdb().set_trace() + ipdb> continue Restore previous trace function, e.g. for coverage.py