mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
Step over yield from: test (PY-18343)
This commit is contained in:
15
python/testData/debug/test_step_over_yield.py
Normal file
15
python/testData/debug/test_step_over_yield.py
Normal file
@@ -0,0 +1,15 @@
|
||||
def generator2():
|
||||
for i in range(4):
|
||||
yield i
|
||||
|
||||
|
||||
def generator():
|
||||
a = 42 #breakpoint
|
||||
yield from generator2()
|
||||
return a
|
||||
|
||||
sum = 0
|
||||
for i in generator():
|
||||
sum += i
|
||||
|
||||
print("The end")
|
||||
@@ -725,6 +725,53 @@ public class PythonDebuggerTest extends PyEnvTestCase {
|
||||
}
|
||||
|
||||
|
||||
public void testStepOverYieldFrom() throws Exception {
|
||||
runPythonTest(new PyDebuggerTask("/debug", "test_step_over_yield.py") {
|
||||
@Override
|
||||
protected void init() {
|
||||
setMultiprocessDebug(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void before() throws Exception {
|
||||
toggleBreakpoint(getScriptPath(), 6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testing() throws Exception {
|
||||
|
||||
waitForPause();
|
||||
|
||||
stepOver();
|
||||
|
||||
waitForPause();
|
||||
|
||||
eval("a").hasValue("42");
|
||||
|
||||
stepOver();
|
||||
|
||||
waitForPause();
|
||||
|
||||
eval("a").hasValue("42");
|
||||
|
||||
stepOver();
|
||||
|
||||
waitForPause();
|
||||
|
||||
eval("sum").hasValue("6");
|
||||
|
||||
resume();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<String> getTags() {
|
||||
return Sets.newHashSet("python34");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//TODO: fix me as I don't work properly sometimes (something connected with process termination on agent)
|
||||
//public void testResume() throws Exception {
|
||||
// runPythonTest(new PyDebuggerTask("/debug", "Test_Resume.py") {
|
||||
|
||||
Reference in New Issue
Block a user