Fix adding break after removing (PY-24026)

This commit is contained in:
Elizaveta Shashkova
2017-06-06 18:51:55 +03:00
parent 47774e6489
commit 7e2e6a2f03
2 changed files with 32 additions and 1 deletions
@@ -73,6 +73,7 @@ def _pydev_stop_at_break():
breakpoint = breakpoints_for_file[line]
except KeyError:
pydev_log.debug("Couldn't find breakpoint in the file {} on line {}".format(frame.f_code.co_filename, line))
t.additional_info.is_tracing = False
return
if breakpoint and handle_breakpoint(frame, t, debugger, breakpoint):
pydev_log.debug("Suspending at breakpoint in file: {} on line {}".format(frame.f_code.co_filename, line))
@@ -1173,7 +1173,6 @@ public class PythonDebuggerTest extends PyEnvTestCase {
public void before() throws Exception {
toggleBreakpoint(getScriptName(), 2);
toggleBreakpoint(getScriptName(), 3);
setWaitForTermination(false);
}
@Override
@@ -1192,6 +1191,37 @@ public class PythonDebuggerTest extends PyEnvTestCase {
});
}
@Test
public void testAddBreakAfterRemove() throws Exception {
runPythonTest(new PyDebuggerTask("/debug", "test1.py") {
@Override
public void before() throws Exception {
toggleBreakpoint(getScriptName(), 2);
}
@Override
public void testing() throws Exception {
waitForPause();
eval("i").hasValue("0");
// remove break on line 2
toggleBreakpoint(getScriptName(), 2);
resume();
// add break on line 2
toggleBreakpoint(getScriptName(), 2);
// check if break on line 2 works
waitForPause();
// remove break on line 2 again
toggleBreakpoint(getScriptName(), 2);
// add break on line 3
toggleBreakpoint(getScriptName(), 3);
resume();
// check if break on line 3 works
waitForPause();
resume();
}
});
}
//TODO: That doesn't work now: case from test_continuation.py and test_continuation2.py are treated differently by interpreter
// (first line is executed in first case and last line in second)