diff --git a/python/helpers/pydev/_pydevd_frame_eval/pydevd_frame_tracing.py b/python/helpers/pydev/_pydevd_frame_eval/pydevd_frame_tracing.py index f429574f5a05..e26e186a8934 100644 --- a/python/helpers/pydev/_pydevd_frame_eval/pydevd_frame_tracing.py +++ b/python/helpers/pydev/_pydevd_frame_eval/pydevd_frame_tracing.py @@ -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)) diff --git a/python/testSrc/com/jetbrains/env/python/PythonDebuggerTest.java b/python/testSrc/com/jetbrains/env/python/PythonDebuggerTest.java index 089f55b2ab3a..e75e27b97ac1 100644 --- a/python/testSrc/com/jetbrains/env/python/PythonDebuggerTest.java +++ b/python/testSrc/com/jetbrains/env/python/PythonDebuggerTest.java @@ -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)