Skip to content

Commit e20345f

Browse files
committed
Fix testing adapter tests
1 parent 9382c2f commit e20345f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/testing/common/testingAdapter.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as path from 'path';
77
import * as assert from 'assert';
88
import * as fs from 'fs';
99
import * as os from 'os';
10+
import * as sinon from 'sinon';
1011
import { PytestTestDiscoveryAdapter } from '../../../client/testing/testController/pytest/pytestDiscoveryAdapter';
1112
import { ITestController, ITestResultResolver } from '../../../client/testing/testController/common/types';
1213
import { IPythonExecutionFactory } from '../../../client/common/process/types';
@@ -22,6 +23,7 @@ import { TestProvider } from '../../../client/testing/types';
2223
import { PYTEST_PROVIDER, UNITTEST_PROVIDER } from '../../../client/testing/common/constants';
2324
import { IEnvironmentVariablesProvider } from '../../../client/common/variables/types';
2425
import { createTypeMoq } from '../../mocks/helper';
26+
import * as pixi from '../../../client/pythonEnvironments/common/environmentManagers/pixi';
2527

2628
suite('End to End Tests: test adapters', () => {
2729
let resultResolver: ITestResultResolver;
@@ -32,6 +34,7 @@ suite('End to End Tests: test adapters', () => {
3234
let workspaceUri: Uri;
3335
let testOutputChannel: typeMoq.IMock<ITestOutputChannel>;
3436
let testController: TestController;
37+
let getPixiStub: sinon.SinonStub;
3538
const unittestProvider: TestProvider = UNITTEST_PROVIDER;
3639
const pytestProvider: TestProvider = PYTEST_PROVIDER;
3740
const rootPathSmallWorkspace = path.join(
@@ -104,6 +107,9 @@ suite('End to End Tests: test adapters', () => {
104107
});
105108

106109
setup(async () => {
110+
getPixiStub = sinon.stub(pixi, 'getPixi');
111+
getPixiStub.resolves(undefined);
112+
107113
// create objects that were injected
108114
configService = serviceContainer.get<IConfigurationService>(IConfigurationService);
109115
pythonExecFactory = serviceContainer.get<IPythonExecutionFactory>(IPythonExecutionFactory);
@@ -130,6 +136,9 @@ suite('End to End Tests: test adapters', () => {
130136
// Whatever you need to return
131137
});
132138
});
139+
teardown(() => {
140+
sinon.restore();
141+
});
133142
suiteTeardown(async () => {
134143
// remove symlink
135144
const dest = rootPathDiscoverySymlink;

0 commit comments

Comments
 (0)