MCPcopy Create free account
hub / github.com/ipython/ipython / test_ipdb_magics2

Function test_ipdb_magics2

IPython/core/tests/test_debugger.py:167–190  ·  view source on GitHub ↗

Test ipdb with a very short function. >>> old_trace = sys.gettrace() >>> def bar(): ... pass Run ipdb. >>> with PdbTestInput([ ... 'continue', ... ]): ... debugger.Pdb().runcall(bar) > (2)bar() 1 def bar(): ----> 2

()

Source from the content-addressed store, hash-verified

165 '''
166
167def test_ipdb_magics2():
168 '''Test ipdb with a very short function.
169
170 >>> old_trace = sys.gettrace()
171
172 >>> def bar():
173 ... pass
174
175 Run ipdb.
176
177 >>> with PdbTestInput([
178 ... 'continue',
179 ... ]):
180 ... debugger.Pdb().runcall(bar)
181 > <doctest ...>(2)bar()
182 1 def bar():
183 ----> 2 pass
184 <BLANKLINE>
185 ipdb> continue
186
187 Restore previous trace function, e.g. for coverage.py
188
189 >>> sys.settrace(old_trace)
190 ''&#x27;
191
192def can_quit():
193 ''&#x27;Test that quit work in ipydb

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected