mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
Add test for argument parsing for subprocess (PY-20476 )
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user