Skip to content

Commit 6b8f19f

Browse files
author
Kartik Raj
committed
fix tests
1 parent 9feabf9 commit 6b8f19f

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/client/pythonEnvironments/base/locatorUtils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ export async function getEnvs<I = PythonEnvInfo>(iterator: IPythonEnvsIterator<I
9595
}
9696
// We don't worry about if envs[index] is set already.
9797
envs[index] = update;
98+
} else if (event.update) {
99+
envs.push(event.update);
98100
}
99101
});
100102
}

src/client/pythonEnvironments/base/locators/lowLevel/windowsRegistryLocator.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
IPythonEnvsIterator,
1111
Locator,
1212
ProgressNotificationEvent,
13+
ProgressReportStage,
1314
PythonEnvUpdatedEvent,
1415
} from '../../locator';
1516
import { getRegistryInterpreters } from '../../../common/windowsUtils';
@@ -66,6 +67,7 @@ async function updateLazily(didUpdate: EventEmitter<PythonEnvUpdatedEvent<BasicE
6667
traceError(`Failed to process environment: ${interpreter}`, ex);
6768
}
6869
}
70+
didUpdate.fire({ stage: ProgressReportStage.discoveryFinished });
6971
traceVerbose('Finished searching for windows registry interpreters');
7072
}
7173

src/test/pythonEnvironments/base/locators/lowLevel/windowsRegistryLocator.unit.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ suite('Windows Registry', () => {
222222
createBasicEnv(PythonEnvKind.OtherGlobal, path.join(regTestRoot, 'python38', 'python.exe')),
223223
].map((e) => ({ ...e, source: [PythonEnvSource.WindowsRegistry] }));
224224

225-
const iterator = locator.iterEnvs(undefined, false);
225+
const iterator = locator.iterEnvs(undefined, true);
226226
const actualEnvs = await getEnvs(iterator);
227227

228228
assertBasicEnvsEqual(actualEnvs, expectedEnvs);
@@ -233,7 +233,7 @@ suite('Windows Registry', () => {
233233
throw Error();
234234
});
235235

236-
const iterator = locator.iterEnvs();
236+
const iterator = locator.iterEnvs(undefined, true);
237237
const actualEnvs = await getEnvs(iterator);
238238

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

255-
const iterator = locator.iterEnvs();
255+
const iterator = locator.iterEnvs(undefined, true);
256256
const actualEnvs = await getEnvs(iterator);
257257

258258
assertBasicEnvsEqual(actualEnvs, expectedEnvs);

0 commit comments

Comments
 (0)