File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
src/client/testing/testController/common Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -180,21 +180,24 @@ export async function startDiscoveryNamedPipe(
180180 * @returns True if the error indicates pytest is not installed
181181 */
182182function isPytestNotInstalledError ( message : string ) : boolean {
183- return message . includes ( 'ModuleNotFoundError' ) && message . includes ( 'pytest' ) ||
184- message . includes ( 'No module named' ) && message . includes ( 'pytest' ) ||
185- message . includes ( 'ImportError' ) && message . includes ( 'pytest' ) ;
183+ return (
184+ ( message . includes ( 'ModuleNotFoundError' ) && message . includes ( 'pytest' ) ) ||
185+ ( message . includes ( 'No module named' ) && message . includes ( 'pytest' ) ) ||
186+ ( message . includes ( 'ImportError' ) && message . includes ( 'pytest' ) )
187+ ) ;
186188}
187189
188190export function buildErrorNodeOptions ( uri : Uri , message : string , testType : string ) : ErrorTestItemOptions {
189191 let labelText = testType === 'pytest' ? 'pytest Discovery Error' : 'Unittest Discovery Error' ;
190192 let errorMessage = message ;
191-
193+
192194 // Provide more specific error message if pytest is not installed
193195 if ( testType === 'pytest' && isPytestNotInstalledError ( message ) ) {
194196 labelText = 'pytest Not Installed' ;
195- errorMessage = 'pytest is not installed in the selected Python environment. Please install pytest to enable test discovery and execution.' ;
197+ errorMessage =
198+ 'pytest is not installed in the selected Python environment. Please install pytest to enable test discovery and execution.' ;
196199 }
197-
200+
198201 return {
199202 id : `DiscoveryError:${ uri . fsPath } ` ,
200203 label : `${ labelText } [${ path . basename ( uri . fsPath ) } ]` ,
You can’t perform that action at this time.
0 commit comments