1
1
'use strict' ;
2
2
import * as vscode from 'vscode' ;
3
+ // tslint:disable-next-line:no-duplicate-imports
3
4
import { Disposable , Uri , window , workspace } from 'vscode' ;
4
5
import { PythonSettings } from '../common/configSettings' ;
5
6
import * as constants from '../common/constants' ;
@@ -77,7 +78,7 @@ async function onDocumentSaved(doc: vscode.TextDocument): Promise<void> {
77
78
if ( timeoutId ) {
78
79
clearTimeout ( timeoutId ) ;
79
80
}
80
- timeoutId = setTimeout ( ( ) => discoverTests ( CommandSource . auto , doc . uri , true ) , 1000 ) ;
81
+ timeoutId = setTimeout ( ( ) => discoverTests ( CommandSource . auto , doc . uri , true , false , true ) , 1000 ) ;
81
82
}
82
83
83
84
function dispose ( ) {
@@ -157,7 +158,7 @@ async function selectAndRunTestMethod(cmdSource: CommandSource, resource: Uri, d
157
158
if ( ! selectedTestFn ) {
158
159
return ;
159
160
}
160
- // tslint:disable-next-line:prefer-type-cast
161
+ // tslint:disable-next-line:prefer-type-cast no-object-literal-type-assertion
161
162
await runTestsImpl ( cmdSource , testManager . workspaceFolder , { testFunction : [ selectedTestFn . testFunction ] } as TestsToRun , false , debug ) ;
162
163
}
163
164
async function selectAndRunTestFile ( cmdSource : CommandSource ) {
@@ -177,7 +178,7 @@ async function selectAndRunTestFile(cmdSource: CommandSource) {
177
178
if ( ! selectedFile ) {
178
179
return ;
179
180
}
180
- // tslint:disable-next-line:prefer-type-cast
181
+ // tslint:disable-next-line:prefer-type-cast no-object-literal-type-assertion
181
182
await runTestsImpl ( cmdSource , testManager . workspaceFolder , { testFile : [ selectedFile ] } as TestsToRun ) ;
182
183
}
183
184
async function runCurrentTestFile ( cmdSource : CommandSource ) {
@@ -200,7 +201,7 @@ async function runCurrentTestFile(cmdSource: CommandSource) {
200
201
if ( testFiles . length < 1 ) {
201
202
return ;
202
203
}
203
- // tslint:disable-next-line:prefer-type-cast
204
+ // tslint:disable-next-line:prefer-type-cast no-object-literal-type-assertion
204
205
await runTestsImpl ( cmdSource , testManager . workspaceFolder , { testFile : [ testFiles [ 0 ] ] } as TestsToRun ) ;
205
206
}
206
207
async function displayStopUI ( message : string ) {
@@ -272,16 +273,16 @@ async function stopTests(resource: Uri) {
272
273
testManager . stop ( ) ;
273
274
}
274
275
}
275
- async function discoverTests ( cmdSource : CommandSource , resource ?: Uri , ignoreCache ?: boolean , userInitiated ?: boolean ) {
276
+ async function discoverTests ( cmdSource : CommandSource , resource ?: Uri , ignoreCache ?: boolean , userInitiated ?: boolean , quietMode ?: boolean ) {
276
277
const testManager = await getTestManager ( true , resource ) ;
277
278
if ( ! testManager ) {
278
279
return ;
279
280
}
280
281
281
282
if ( testManager && ( testManager . status !== TestStatus . Discovering && testManager . status !== TestStatus . Running ) ) {
282
- testResultDisplay = testResultDisplay ? testResultDisplay : new TestResultDisplay ( outChannel , onDidChange ) ;
283
- const discoveryPromise = testManager . discoverTests ( cmdSource , ignoreCache , false , userInitiated ) ;
284
- testResultDisplay . displayDiscoverStatus ( discoveryPromise )
283
+ testResultDisplay = testResultDisplay ? testResultDisplay : new TestResultDisplay ( onDidChange ) ;
284
+ const discoveryPromise = testManager . discoverTests ( cmdSource , ignoreCache , quietMode , userInitiated ) ;
285
+ testResultDisplay . displayDiscoverStatus ( discoveryPromise , quietMode )
285
286
. catch ( ex => console . error ( 'Python Extension: displayDiscoverStatus' , ex ) ) ;
286
287
await discoveryPromise ;
287
288
}
@@ -292,7 +293,7 @@ async function runTestsImpl(cmdSource: CommandSource, resource?: Uri, testsToRun
292
293
return ;
293
294
}
294
295
295
- testResultDisplay = testResultDisplay ? testResultDisplay : new TestResultDisplay ( outChannel , onDidChange ) ;
296
+ testResultDisplay = testResultDisplay ? testResultDisplay : new TestResultDisplay ( onDidChange ) ;
296
297
const promise = testManager . runTest ( cmdSource , testsToRun , runFailedTests , debug )
297
298
. catch ( reason => {
298
299
if ( reason !== CANCELLATION_REASON ) {
0 commit comments