Skip to content

Commit

Permalink
Fix testing adapter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig committed Oct 18, 2024
1 parent 9382c2f commit e20345f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/testing/common/testingAdapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as path from 'path';
import * as assert from 'assert';
import * as fs from 'fs';
import * as os from 'os';
import * as sinon from 'sinon';
import { PytestTestDiscoveryAdapter } from '../../../client/testing/testController/pytest/pytestDiscoveryAdapter';
import { ITestController, ITestResultResolver } from '../../../client/testing/testController/common/types';
import { IPythonExecutionFactory } from '../../../client/common/process/types';
Expand All @@ -22,6 +23,7 @@ import { TestProvider } from '../../../client/testing/types';
import { PYTEST_PROVIDER, UNITTEST_PROVIDER } from '../../../client/testing/common/constants';
import { IEnvironmentVariablesProvider } from '../../../client/common/variables/types';
import { createTypeMoq } from '../../mocks/helper';
import * as pixi from '../../../client/pythonEnvironments/common/environmentManagers/pixi';

suite('End to End Tests: test adapters', () => {
let resultResolver: ITestResultResolver;
Expand All @@ -32,6 +34,7 @@ suite('End to End Tests: test adapters', () => {
let workspaceUri: Uri;
let testOutputChannel: typeMoq.IMock<ITestOutputChannel>;
let testController: TestController;
let getPixiStub: sinon.SinonStub;
const unittestProvider: TestProvider = UNITTEST_PROVIDER;
const pytestProvider: TestProvider = PYTEST_PROVIDER;
const rootPathSmallWorkspace = path.join(
Expand Down Expand Up @@ -104,6 +107,9 @@ suite('End to End Tests: test adapters', () => {
});

setup(async () => {
getPixiStub = sinon.stub(pixi, 'getPixi');
getPixiStub.resolves(undefined);

// create objects that were injected
configService = serviceContainer.get<IConfigurationService>(IConfigurationService);
pythonExecFactory = serviceContainer.get<IPythonExecutionFactory>(IPythonExecutionFactory);
Expand All @@ -130,6 +136,9 @@ suite('End to End Tests: test adapters', () => {
// Whatever you need to return
});
});
teardown(() => {
sinon.restore();
});
suiteTeardown(async () => {
// remove symlink
const dest = rootPathDiscoverySymlink;
Expand Down

0 comments on commit e20345f

Please sign in to comment.