Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartik Raj committed Feb 5, 2024
1 parent 9feabf9 commit 6b8f19f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/client/pythonEnvironments/base/locatorUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ export async function getEnvs<I = PythonEnvInfo>(iterator: IPythonEnvsIterator<I
}
// We don't worry about if envs[index] is set already.
envs[index] = update;
} else if (event.update) {
envs.push(event.update);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
IPythonEnvsIterator,
Locator,
ProgressNotificationEvent,
ProgressReportStage,
PythonEnvUpdatedEvent,
} from '../../locator';
import { getRegistryInterpreters } from '../../../common/windowsUtils';
Expand Down Expand Up @@ -66,6 +67,7 @@ async function updateLazily(didUpdate: EventEmitter<PythonEnvUpdatedEvent<BasicE
traceError(`Failed to process environment: ${interpreter}`, ex);
}
}
didUpdate.fire({ stage: ProgressReportStage.discoveryFinished });
traceVerbose('Finished searching for windows registry interpreters');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ suite('Windows Registry', () => {
createBasicEnv(PythonEnvKind.OtherGlobal, path.join(regTestRoot, 'python38', 'python.exe')),
].map((e) => ({ ...e, source: [PythonEnvSource.WindowsRegistry] }));

const iterator = locator.iterEnvs(undefined, false);
const iterator = locator.iterEnvs(undefined, true);
const actualEnvs = await getEnvs(iterator);

assertBasicEnvsEqual(actualEnvs, expectedEnvs);
Expand All @@ -233,7 +233,7 @@ suite('Windows Registry', () => {
throw Error();
});

const iterator = locator.iterEnvs();
const iterator = locator.iterEnvs(undefined, true);
const actualEnvs = await getEnvs(iterator);

assert.deepStrictEqual(actualEnvs, []);
Expand All @@ -252,7 +252,7 @@ suite('Windows Registry', () => {
createBasicEnv(PythonEnvKind.OtherGlobal, path.join(regTestRoot, 'python38', 'python.exe')),
].map((e) => ({ ...e, source: [PythonEnvSource.WindowsRegistry] }));

const iterator = locator.iterEnvs();
const iterator = locator.iterEnvs(undefined, true);
const actualEnvs = await getEnvs(iterator);

assertBasicEnvsEqual(actualEnvs, expectedEnvs);
Expand Down

0 comments on commit 6b8f19f

Please sign in to comment.