mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Tests: add timeout for exec() and fix console tests
This commit is contained in:
@@ -39,7 +39,7 @@ public class PythonConsoleTest extends PyEnvTestCase {
|
||||
@Override
|
||||
public void testing() throws Exception {
|
||||
exec("if True:\n" +
|
||||
" x=1\n" +
|
||||
" x=1\n" +
|
||||
"y=x+100\n" +
|
||||
"for i in range(1):\n" +
|
||||
" print(y)\n");
|
||||
@@ -86,10 +86,8 @@ public class PythonConsoleTest extends PyEnvTestCase {
|
||||
public void testing() throws Exception {
|
||||
exec("x = 96");
|
||||
exec("x +=1");
|
||||
exec("if True:");
|
||||
exec(" print(x)");
|
||||
exec("");
|
||||
exec("");
|
||||
exec("if True:\n" +
|
||||
" print(x)\n");
|
||||
waitForOutput("97");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -324,6 +324,9 @@ public class PyConsoleTask extends PyExecutionFixtureTestTask {
|
||||
myConsoleView.executeInConsole(command);
|
||||
}
|
||||
});
|
||||
Assert.assertTrue(String.format("Command execution wasn't finished: `%s` \n" +
|
||||
"Output: %s", command, output()), waitFor(myCommandSemaphore));
|
||||
myCommandSemaphore.release();
|
||||
}
|
||||
|
||||
protected boolean hasValue(String varName, String value) throws PyDebuggerException {
|
||||
|
||||
Reference in New Issue
Block a user