Skip to content

Commit 8b06a93

Browse files
committed
few small fixes
1 parent 97a8270 commit 8b06a93

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/client/testing/testController/controller.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { inject, injectable, named } from 'inversify';
55
import { uniq } from 'lodash';
6-
import { minimatch } from 'minimatch';
6+
import * as minimatch from 'minimatch';
77
import {
88
CancellationToken,
99
TestController,
@@ -216,7 +216,7 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
216216
if (settings.testing.autoTestDiscoverOnSaveEnabled) {
217217
traceVerbose(`Testing: Setting up watcher for ${workspace.uri.fsPath}`);
218218
this.watchForSettingsChanges(workspace);
219-
this.watchForTestContentChangeOnSave(settings.testing.autoTestDiscoverOnSavePattern);
219+
this.watchForTestContentChangeOnSave();
220220
}
221221
});
222222
}
@@ -550,10 +550,11 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
550550
);
551551
}
552552

553-
private watchForTestContentChangeOnSave(testFileGlob: String): void {
553+
private watchForTestContentChangeOnSave(): void {
554554
this.disposables.push(
555555
onDidSaveTextDocument(async (doc: TextDocument) => {
556-
if (minimatch(doc.uri.fs, testFileGlob)) {
556+
const settings = this.configSettings.getSettings(doc.uri);
557+
if (minimatch.default(doc.uri.fsPath, settings.testing.autoTestDiscoverOnSavePattern)) {
557558
traceVerbose(`Testing: Trigger refresh after saving ${doc.uri.fsPath}`);
558559
this.sendTriggerTelemetry('watching');
559560
this.refreshData.trigger(doc.uri, false);

0 commit comments

Comments
 (0)