Skip to content

Commit 7b7d9c6

Browse files
committed
Small UX fixes
1 parent 0b81ef0 commit 7b7d9c6

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

src/main/java/org/netbeans/modules/python/PythonUtility.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.netbeans.api.project.ui.OpenProjects;
3636
import org.netbeans.modules.python.options.PythonPlatformManager;
3737
import static org.netbeans.modules.python.options.PythonPlatformManager.getPathFile;
38+
import org.netbeans.modules.python.project.PythonProject;
3839
import org.openide.awt.NotificationDisplayer;
3940
import org.openide.filesystems.FileObject;
4041
import org.openide.filesystems.FileUtil;
@@ -293,7 +294,7 @@ public static int venvPackageInstaller(FileObject projectDirectory) {
293294
"pip",
294295
"install"
295296
};
296-
return processExecutor(ArrayUtils.addAll(cmd, VENV_DEPS), "Install packages");
297+
return processExecutor(ArrayUtils.addAll(cmd, VENV_DEPS), "Installing packages");
297298
}
298299

299300
public static String normalizeVenvPath(Path base) {
@@ -343,7 +344,7 @@ public static int processExecutor(String[] cmd, String message) {
343344
}
344345

345346
@NbBundle.Messages({
346-
"CTL_CreatePylsp=Create pylsp environment",
347+
"CTL_CreatePylsp=Creating pylsp environment",
347348
"CTL_PylspInstallIssue=Issue when creating Pylsp environment.",
348349
"CTL_PylspRetry=Retry"
349350
})
@@ -411,7 +412,7 @@ public static String getPipList(String exe) throws IOException {
411412
}
412413

413414
@NbBundle.Messages({
414-
"CTL_InstallDeps=Install pylsp dependencies",
415+
"CTL_InstallDeps=Installing pylsp dependencies",
415416
"CTL_MissingDeps=Missing dependency:"
416417
})
417418
public static int finish() {

src/main/java/org/netbeans/modules/python/testrunner/PythonUnitTestRunner.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.netbeans.modules.python.testrunner;
22

3-
import org.netbeans.modules.python.coverage.PythonCodeCoverageProvider;
43
import java.io.File;
54
import java.io.IOException;
65
import java.nio.file.Paths;
@@ -34,9 +33,12 @@
3433
import org.netbeans.modules.gsf.testrunner.ui.api.Manager;
3534
import org.netbeans.modules.gsf.testrunner.ui.api.TestMethodController;
3635
import org.netbeans.modules.python.PythonOutputLine;
37-
import org.netbeans.modules.python.PythonProject;
36+
import org.netbeans.modules.python.project.PythonProject;
3837
import org.netbeans.modules.python.PythonUtility;
38+
import org.netbeans.modules.python.coverage.PythonCodeCoverageProvider;
3939
import org.netbeans.spi.project.SingleMethod;
40+
import org.openide.DialogDisplayer;
41+
import org.openide.NotifyDescriptor;
4042
import org.openide.filesystems.FileObject;
4143
import org.openide.filesystems.FileUtil;
4244
import org.openide.loaders.DataObject;
@@ -61,6 +63,11 @@ public void runSingleTest(PythonProject project, DataObject dob) {
6163
Object[] runParams = PythonTestManager.getTestRunParams(project);
6264
String runner = runParams[0].toString();
6365

66+
if (runner.equals("pytest")) {
67+
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message("PyTest not supported at the moment", NotifyDescriptor.INFORMATION_MESSAGE));
68+
return;
69+
}
70+
6471
ProcessBuilder pb = new ProcessBuilder();
6572
pb.directory(FileUtil.toFile(pfo));
6673
PythonUtility.manageRunEnvs(pb);
@@ -117,6 +124,12 @@ public void runAllTests(PythonProject project, DataObject dob) {
117124

118125
Object[] runParams = PythonTestManager.getTestRunParams(project);
119126
String runner = runParams[0].toString();
127+
128+
if (runner.equals("pytest")) {
129+
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message("PyTest not supported at the moment", NotifyDescriptor.INFORMATION_MESSAGE));
130+
return;
131+
}
132+
120133
String[] params = (String[]) runParams[1];
121134

122135
ProcessBuilder pb = new ProcessBuilder();
@@ -256,6 +269,11 @@ public void runTestMethod(PythonProject project, TestMethodController.TestMethod
256269
Object[] runParams = PythonTestManager.getTestRunParams(project);
257270
String runner = runParams[0].toString();
258271

272+
if (runner.equals("pytest")) {
273+
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message("PyTest not supported at the moment", NotifyDescriptor.INFORMATION_MESSAGE));
274+
return;
275+
}
276+
259277
ProcessBuilder pb = new ProcessBuilder();
260278
pb.directory(FileUtil.toFile(project.getProjectDirectory())/*.getParentFile()*/);
261279
PythonUtility.manageRunEnvs(pb);

0 commit comments

Comments
 (0)