##// END OF EJS Templates
Add test that quit and exit work in debugger....
Matthias Bussonnier -
Show More
@@ -69,7 +69,7 b' def test_longer_repr():'
69 nt.assert_equal(trepr(a), a_trunc)
69 nt.assert_equal(trepr(a), a_trunc)
70 # The creation of our tracer modifies the repr module's repr function
70 # The creation of our tracer modifies the repr module's repr function
71 # in-place, since that global is used directly by the stdlib's pdb module.
71 # in-place, since that global is used directly by the stdlib's pdb module.
72 t = debugger.Tracer()
72 debugger.Tracer()
73 nt.assert_equal(trepr(a), ar)
73 nt.assert_equal(trepr(a), ar)
74
74
75 def test_ipdb_magics():
75 def test_ipdb_magics():
@@ -184,3 +184,50 b' def test_ipdb_magics2():'
184
184
185 >>> sys.settrace(old_trace)
185 >>> sys.settrace(old_trace)
186 '''
186 '''
187
188 def can_quit():
189 '''Test that quit work in ipydb
190
191 >>> old_trace = sys.gettrace()
192
193 >>> def bar():
194 ... pass
195
196 >>> with PdbTestInput([
197 ... 'quit',
198 ... ]):
199 ... debugger.Pdb().runcall(bar)
200 > <doctest ...>(2)bar()
201 1 def bar():
202 ----> 2 pass
203 <BLANKLINE>
204 ipdb> quit
205
206 Restore previous trace function, e.g. for coverage.py
207
208 >>> sys.settrace(old_trace)
209 '''
210
211
212 def can_exit():
213 '''Test that quit work in ipydb
214
215 >>> old_trace = sys.gettrace()
216
217 >>> def bar():
218 ... pass
219
220 >>> with PdbTestInput([
221 ... 'exit',
222 ... ]):
223 ... debugger.Pdb().runcall(bar)
224 > <doctest ...>(2)bar()
225 1 def bar():
226 ----> 2 pass
227 <BLANKLINE>
228 ipdb> exit
229
230 Restore previous trace function, e.g. for coverage.py
231
232 >>> sys.settrace(old_trace)
233 '''
General Comments 0
You need to be logged in to leave comments. Login now