import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.remote.RemoteSdkAdditionalData;
import com.intellij.xdebugger.XDebugProcess;
import com.intellij.xdebugger.XDebugProcessStarter;
import com.intellij.xdebugger.XDebugSession;
public static void configureCommonDebugParameters(@NotNull Project project,
@NotNull ParamsGroup debugParams) {
if (isModule) {
- debugParams.addParameter("--module");
+ debugParams.addParameter(MODULE_PARAM);
}
if (ApplicationManager.getApplication().isUnitTestMode()) {
import com.jetbrains.python.debugger.pydev.PyDebugCallback;
import com.jetbrains.python.debugger.settings.PyDebuggerSettings;
import com.jetbrains.python.debugger.settings.PySteppingFilter;
+import com.jetbrains.python.sdk.PythonEnvUtil;
import com.jetbrains.python.sdk.flavors.PythonSdkFlavor;
import com.jetbrains.python.sdkTools.SdkCreationType;
import org.jetbrains.annotations.NotNull;
*/
public class PythonDebuggerTest extends PyEnvTestCase {
- @Test
- public void testBreakpointStopAndEval() throws Exception {
- runPythonTest(new PyDebuggerTask("/debug", "test1.py") {
- @Override
- public void before() throws Exception {
- toggleBreakpoint(getFilePath(getScriptName()), 3);
- }
+ private class BreakpointStopAndEvalTask extends PyDebuggerTask {
+ public BreakpointStopAndEvalTask() {
+ super("/debug", "test1.py");
+ }
- @Override
- public void testing() throws Exception {
- waitForPause();
+ @Override
+ public void before() throws Exception {
+ toggleBreakpoint(getFilePath(getScriptName()), 3);
+ }
- eval("i").hasValue("0");
+ @Override
+ public void testing() throws Exception {
+ waitForPause();
- resume();
+ eval("i").hasValue("0");
- waitForPause();
+ resume();
- eval("i").hasValue("1");
+ waitForPause();
- resume();
+ eval("i").hasValue("1");
- waitForPause();
+ resume();
- eval("i").hasValue("2");
- }
- });
+ waitForPause();
+
+ eval("i").hasValue("2");
+ }
+ }
+
+ @Test
+ public void testBreakpointStopAndEval() throws Exception {
+ runPythonTest(new BreakpointStopAndEvalTask());
}
@Test
}
});
}
+
+ @Staging
+ @Test
+ public void testModuleInterpreterOption() throws Exception {
+ runPythonTest(new BreakpointStopAndEvalTask() {
+ @Override
+ public void before() throws Exception {
+ super.before();
+
+ PythonEnvUtil.addToPythonPath(myRunConfiguration.getEnvs(), new File(getFilePath(getScriptName())).getParent());
+
+ myRunConfiguration.setInterpreterOptions("-m runner");
+ }
+ });
+ }
}