##// END OF EJS Templates
fix: Clear breakpoints before running any script with debugger
Ritesh Kadmawala -
Show More
@@ -849,6 +849,7 b' python-profiler package from non-free.""")'
849 bdb.Breakpoint.next = 1
849 bdb.Breakpoint.next = 1
850 bdb.Breakpoint.bplist = {}
850 bdb.Breakpoint.bplist = {}
851 bdb.Breakpoint.bpbynumber = [None]
851 bdb.Breakpoint.bpbynumber = [None]
852 deb.clear_all_breaks()
852 if bp_line is not None:
853 if bp_line is not None:
853 # Set an initial breakpoint to stop execution
854 # Set an initial breakpoint to stop execution
854 maxtries = 10
855 maxtries = 10
@@ -165,8 +165,8 b' def doctest_reset_del():'
165 class TestMagicRunPass(tt.TempFileMixin):
165 class TestMagicRunPass(tt.TempFileMixin):
166
166
167 def setup(self):
167 def setup(self):
168 """Make a valid python temp file."""
168 content = "a = [1,2,3]\nb = 1"
169 self.mktmp('pass\n')
169 self.mktmp(content)
170
170
171 def run_tmpfile(self):
171 def run_tmpfile(self):
172 _ip = get_ipython()
172 _ip = get_ipython()
@@ -213,6 +213,16 b' class TestMagicRunPass(tt.TempFileMixin):'
213 with tt.fake_input(['c']):
213 with tt.fake_input(['c']):
214 _ip.magic('run -d %s' % self.fname)
214 _ip.magic('run -d %s' % self.fname)
215
215
216 def test_run_debug_twice_with_breakpoint(self):
217 """Make a valid python temp file."""
218 _ip = get_ipython()
219 with tt.fake_input(['b 2', 'c', 'c']):
220 _ip.magic('run -d %s' % self.fname)
221
222 with tt.fake_input(['c']):
223 with tt.AssertNotPrints('KeyError'):
224 _ip.magic('run -d %s' % self.fname)
225
216
226
217 class TestMagicRunSimple(tt.TempFileMixin):
227 class TestMagicRunSimple(tt.TempFileMixin):
218
228
General Comments 0
You need to be logged in to leave comments. Login now