Tests: add timeout for exec() and fix console tests

This commit is contained in:
Elizaveta Shashkova
2016-10-28 18:56:12 +03:00
parent decb9c1853
commit c53db673cc
2 changed files with 6 additions and 5 deletions
@@ -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 {