Skip to content

Commit 23365af

Browse files
author
Kartik Raj
committed
Fix more tests
1 parent 9ef3352 commit 23365af

File tree

2 files changed

+2
-28
lines changed

2 files changed

+2
-28
lines changed

src/client/interpreter/interpreterService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ export class InterpreterService implements Disposable, IInterpreterService {
178178

179179
public async getAllInterpreters(resource?: Uri, options?: GetInterpreterOptions): Promise<PythonEnvironment[]> {
180180
if (options?.ignoreCache) {
181-
this.pyenvs.triggerRefresh();
181+
this.triggerRefresh().ignoreErrors();
182182
}
183-
await this.pyenvs.refreshPromise;
183+
await this.refreshPromise;
184184
return this.getInterpreters(resource, options);
185185
}
186186

src/test/application/diagnostics/checks/pythonInterpreter.unit.test.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -148,32 +148,6 @@ suite('Application Diagnostics - Checks Python Interpreter', () => {
148148
'not the same',
149149
);
150150
});
151-
test('Should return empty diagnostics if there are interpreters after double-checking', async () => {
152-
const interpreter: PythonEnvironment = { envType: EnvironmentType.Unknown } as any;
153-
154-
settings
155-
.setup((s) => s.disableInstallationChecks)
156-
.returns(() => false)
157-
.verifiable(typemoq.Times.once());
158-
interpreterService
159-
.setup((i) => i.hasInterpreters())
160-
.returns(() => Promise.resolve(false))
161-
.verifiable(typemoq.Times.once());
162-
interpreterService
163-
.setup((i) => i.getInterpreters(undefined))
164-
.returns(() => Promise.resolve([interpreter]))
165-
.verifiable(typemoq.Times.once());
166-
interpreterService
167-
.setup((i) => i.getActiveInterpreter(typemoq.It.isAny()))
168-
.returns(() => {
169-
return Promise.resolve(interpreter);
170-
})
171-
.verifiable(typemoq.Times.once());
172-
173-
const diagnostics = await diagnosticService.diagnose(undefined);
174-
175-
expect(diagnostics).to.be.deep.equal([], 'not the same');
176-
});
177151
test('Should return invalid diagnostics if there are interpreters but no current interpreter', async () => {
178152
settings
179153
.setup((s) => s.disableInstallationChecks)

0 commit comments

Comments
 (0)