Add test for argument parsing for subprocess (PY-20476 )

This commit is contained in:
Elizaveta Shashkova
2016-09-02 15:34:58 +03:00
parent 38d97f9f2a
commit 3aea92aeab
2 changed files with 46 additions and 0 deletions
@@ -0,0 +1,15 @@
import time
import multiprocessing
import subprocess
import sys
import os
def run(name):
dir_path = os.path.dirname(os.path.realpath(__file__))
subprocess.Popen(('%s' % sys.executable, os.path.join(dir_path, "test_remote.py"), name, "etc etc"))
if __name__ == '__main__':
multiprocessing.Process(target=run, args=("subprocess",)).start()
while True:
time.sleep(0.1)
@@ -699,6 +699,37 @@ public class PythonDebuggerTest extends PyEnvTestCase {
});
}
@Test
@Staging
public void testMultiprocessingSubprocess() throws Exception {
runPythonTest(new PyDebuggerTask("/debug", "test_multiprocess_args.py") {
@Override
protected void init() {
setMultiprocessDebug(true);
}
@Override
public void before() throws Exception {
toggleBreakpoint(getFilePath("test_remote.py"), 2);
}
@Override
public void testing() throws Exception {
waitForPause();
eval("sys.argv[1]").hasValue("'subprocess'");
eval("sys.argv[2]").hasValue("'etc etc'");
resume();
}
@NotNull
@Override
public Set<String> getTags() {
return ImmutableSet.of("-iron", "-jython"); //can't run on iron and jython
}
});
}
@Test
@Staging
public void testPyQtQThreadInheritor() throws Exception {