Skip to content

Commit

Permalink
Fix failing global virtual env watcher tests (microsoft#14633)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartik Raj authored and karthiknadig committed Nov 9, 2020
1 parent 618f068 commit bbfcd42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function watchLocationForPythonBinaries(
const disposables = new DisposableRegistry();
for (const pattern of patterns) {
disposables.push(watchLocationForPattern(baseDir, pattern, (type: FileChangeType, e: string) => {
const isMatch = minimatch(e, path.join('**', executableBaseGlob), { nocase: getOSType() === OSType.Windows });
const isMatch = minimatch(path.basename(e), executableBaseGlob, { nocase: getOSType() === OSType.Windows });
if (!isMatch) {
// When deleting the file for some reason path to all directories leading up to python are reported
// Skip those events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ suite('GlobalVirtualEnvironment Locator', async () => {
setup(async () => {
process.env.WORKON_HOME = testWorkOnHomePath;
locator = new GlobalVirtualEnvironmentLocator();
await locator.initialize();
// Wait for watchers to get ready
await sleep(1000);
});
Expand Down

0 comments on commit bbfcd42

Please sign in to comment.