Skip to content

Commit 6bbdbb2

Browse files
Kartik Rajkarthiknadig
authored andcommitted
Fix failing global virtual env watcher tests (microsoft#14633)
1 parent 6682259 commit 6bbdbb2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/client/pythonEnvironments/common/pythonBinariesWatcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function watchLocationForPythonBinaries(
2929
const disposables = new DisposableRegistry();
3030
for (const pattern of patterns) {
3131
disposables.push(watchLocationForPattern(baseDir, pattern, (type: FileChangeType, e: string) => {
32-
const isMatch = minimatch(e, path.join('**', executableBaseGlob), { nocase: getOSType() === OSType.Windows });
32+
const isMatch = minimatch(path.basename(e), executableBaseGlob, { nocase: getOSType() === OSType.Windows });
3333
if (!isMatch) {
3434
// When deleting the file for some reason path to all directories leading up to python are reported
3535
// Skip those events

src/test/pythonEnvironments/discovery/locators/globalVirtualEnvironmentLocator.testvirtualenvs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ suite('GlobalVirtualEnvironment Locator', async () => {
6262
setup(async () => {
6363
process.env.WORKON_HOME = testWorkOnHomePath;
6464
locator = new GlobalVirtualEnvironmentLocator();
65+
await locator.initialize();
6566
// Wait for watchers to get ready
6667
await sleep(1000);
6768
});

0 commit comments

Comments
 (0)