@@ -19,7 +19,7 @@ const settingsInArgsToExcludeForDiscovery = ['--maxfail', '--capture',
1919 '-r ' , '--report' , '--tb' , '--color' , '--durations' , '--pastebin' ,
2020 '--junit-xml=path' , '--junit-prefix' , '--result-log' ] ;
2121
22- export function discoverTests ( rootDirectory : string , args : string [ ] , token : vscode . CancellationToken ) : Promise < Tests > {
22+ export function discoverTests ( rootDirectory : string , args : string [ ] , token : vscode . CancellationToken , ignoreCache : boolean ) : Promise < Tests > {
2323 let logOutputLines : string [ ] = [ '' ] ;
2424 let testFiles : TestFile [ ] = [ ] ;
2525 let parentNodes : { indent : number , item : TestFile | TestSuite } [ ] = [ ] ;
@@ -39,7 +39,9 @@ export function discoverTests(rootDirectory: string, args: string[], token: vsco
3939 }
4040 return true ;
4141 } ) ;
42-
42+ if ( ignoreCache && args . indexOf ( '--cache-clear' ) === - 1 ) {
43+ args . push ( '--cache-clear' ) ;
44+ }
4345 function processOutput ( output : string ) {
4446 output . split ( / \r ? \n / g) . forEach ( ( line , index , lines ) => {
4547 if ( token && token . isCancellationRequested ) {
@@ -113,7 +115,7 @@ function parsePyTestModuleCollectionError(rootDirectory: string, lines: string[]
113115 fileName = fileName . substr ( 0 , fileName . lastIndexOf ( ' ' ) ) ;
114116
115117 const currentPackage = convertFileToPackage ( fileName ) ;
116- const fullyQualifiedName = path . isAbsolute ( fileName ) ? fileName : path . resolve ( rootDirectory , fileName )
118+ const fullyQualifiedName = path . isAbsolute ( fileName ) ? fileName : path . resolve ( rootDirectory , fileName ) ;
117119 const testFile = {
118120 functions : [ ] , suites : [ ] , name : fileName , fullPath : fullyQualifiedName ,
119121 nameToRun : fileName , xmlName : currentPackage , time : 0 , errorsWhenDiscovering : lines . join ( '\n' )
0 commit comments