11package org .netbeans .modules .python .testrunner ;
22
3- import org .netbeans .modules .python .coverage .PythonCodeCoverageProvider ;
43import java .io .File ;
54import java .io .IOException ;
65import java .nio .file .Paths ;
3433import org .netbeans .modules .gsf .testrunner .ui .api .Manager ;
3534import org .netbeans .modules .gsf .testrunner .ui .api .TestMethodController ;
3635import org .netbeans .modules .python .PythonOutputLine ;
37- import org .netbeans .modules .python .PythonProject ;
36+ import org .netbeans .modules .python .project . PythonProject ;
3837import org .netbeans .modules .python .PythonUtility ;
38+ import org .netbeans .modules .python .coverage .PythonCodeCoverageProvider ;
3939import org .netbeans .spi .project .SingleMethod ;
40+ import org .openide .DialogDisplayer ;
41+ import org .openide .NotifyDescriptor ;
4042import org .openide .filesystems .FileObject ;
4143import org .openide .filesystems .FileUtil ;
4244import 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