mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Add test (PY-13540)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
|
||||
def bar():
|
||||
return [1, 2, 3]
|
||||
|
||||
|
||||
def foo():
|
||||
bar()
|
||||
return 33
|
||||
|
||||
|
||||
foo()
|
||||
a = 1
|
||||
b = 2
|
||||
@@ -18,6 +18,7 @@ import com.jetbrains.env.python.debug.PyDebuggerTask;
|
||||
import com.jetbrains.env.ut.PyUnitTestProcessRunner;
|
||||
import com.jetbrains.python.PythonHelpersLocator;
|
||||
import com.jetbrains.python.console.pydev.PydevCompletionVariant;
|
||||
import com.jetbrains.python.debugger.PyDebugValue;
|
||||
import com.jetbrains.python.debugger.PyDebuggerException;
|
||||
import com.jetbrains.python.debugger.PyExceptionBreakpointProperties;
|
||||
import com.jetbrains.python.debugger.PyExceptionBreakpointType;
|
||||
@@ -908,6 +909,35 @@ public class PythonDebuggerTest extends PyEnvTestCase {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReturnValues() throws Exception {
|
||||
runPythonTest(new PyDebuggerTask("/debug", "test_return_values.py") {
|
||||
@Override
|
||||
public void before() throws Exception {
|
||||
toggleBreakpoint(getScriptPath(), 7);
|
||||
toggleBreakpoint(getScriptPath(), 11);
|
||||
final PyDebuggerSettings debuggerSettings = PyDebuggerSettings.getInstance();
|
||||
debuggerSettings.WATCH_RETURN_VALUES = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFinally() {
|
||||
final PyDebuggerSettings debuggerSettings = PyDebuggerSettings.getInstance();
|
||||
debuggerSettings.WATCH_RETURN_VALUES = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testing() throws Exception {
|
||||
waitForPause();
|
||||
eval(PyDebugValue.RETURN_VALUES_PREFIX + "bar[0]").hasValue("1");
|
||||
resume();
|
||||
waitForPause();
|
||||
eval(PyDebugValue.RETURN_VALUES_PREFIX + "foo").hasValue("33");
|
||||
resume();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//TODO: fix me as I don't work properly sometimes (something connected with process termination on agent)
|
||||
@Staging
|
||||
|
||||
Reference in New Issue
Block a user