Skip to content

Commit 8492542

Browse files
committed
v2.2
1 parent 9533e9d commit 8492542

File tree

6 files changed

+15
-373
lines changed

6 files changed

+15
-373
lines changed

src/client/testing/common/debugLauncher.ts

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { getConfigurationsForWorkspace } from '../../debugger/extension/configur
1616
import { getWorkspaceFolder, getWorkspaceFolders } from '../../common/vscodeApis/workspaceApis';
1717
import { showErrorMessage } from '../../common/vscodeApis/windowApis';
1818
import { createDeferred } from '../../common/utils/async';
19-
import { pythonTestAdapterRewriteEnabled } from '../testController/common/utils';
2019
import { addPathToPythonpath } from './helpers';
2120

2221
@injectable()
@@ -199,11 +198,10 @@ export class DebugLauncher implements ITestDebugLauncher {
199198
workspaceFolder: WorkspaceFolder,
200199
options: LaunchOptions,
201200
): Promise<LaunchRequestArguments> {
202-
const pythonTestAdapterRewriteExperiment = pythonTestAdapterRewriteEnabled(this.serviceContainer);
203201
const configArgs = debugConfig as LaunchRequestArguments;
204202
const testArgs =
205203
options.testProvider === 'unittest' ? options.args.filter((item) => item !== '--debug') : options.args;
206-
const script = DebugLauncher.getTestLauncherScript(options.testProvider, pythonTestAdapterRewriteExperiment);
204+
const script = DebugLauncher.getTestLauncherScript(options.testProvider);
207205
const args = script(testArgs);
208206
const [program] = args;
209207
configArgs.program = program;
@@ -229,19 +227,18 @@ export class DebugLauncher implements ITestDebugLauncher {
229227
}
230228
launchArgs.request = 'launch';
231229

232-
if (pythonTestAdapterRewriteExperiment) {
233-
if (options.pytestPort && options.runTestIdsPort) {
234-
launchArgs.env = {
235-
...launchArgs.env,
236-
TEST_RUN_PIPE: options.pytestPort,
237-
RUN_TEST_IDS_PIPE: options.runTestIdsPort,
238-
};
239-
} else {
240-
throw Error(
241-
`Missing value for debug setup, both port and uuid need to be defined. port: "${options.pytestPort}" uuid: "${options.pytestUUID}"`,
242-
);
243-
}
230+
if (options.pytestPort && options.runTestIdsPort) {
231+
launchArgs.env = {
232+
...launchArgs.env,
233+
TEST_RUN_PIPE: options.pytestPort,
234+
RUN_TEST_IDS_PIPE: options.runTestIdsPort,
235+
};
236+
} else {
237+
throw Error(
238+
`Missing value for debug setup, both port and uuid need to be defined. port: "${options.pytestPort}" uuid: "${options.pytestUUID}"`,
239+
);
244240
}
241+
245242
const pluginPath = path.join(EXTENSION_ROOT_DIR, 'python_files');
246243
// check if PYTHONPATH is already set in the environment variables
247244
if (launchArgs.env) {
@@ -263,19 +260,13 @@ export class DebugLauncher implements ITestDebugLauncher {
263260
return launchArgs;
264261
}
265262

266-
private static getTestLauncherScript(testProvider: TestProvider, pythonTestAdapterRewriteExperiment?: boolean) {
263+
private static getTestLauncherScript(testProvider: TestProvider) {
267264
switch (testProvider) {
268265
case 'unittest': {
269-
if (pythonTestAdapterRewriteExperiment) {
270-
return internalScripts.execution_py_testlauncher; // this is the new way to run unittest execution, debugger
271-
}
272-
return internalScripts.visualstudio_py_testlauncher; // old way unittest execution, debugger
266+
return internalScripts.execution_py_testlauncher; // this is the new way to run unittest execution, debugger
273267
}
274268
case 'pytest': {
275-
if (pythonTestAdapterRewriteExperiment) {
276-
return internalScripts.pytestlauncher; // this is the new way to run pytest execution, debugger
277-
}
278-
return internalScripts.testlauncher; // old way pytest execution, debugger
269+
return internalScripts.pytestlauncher; // this is the new way to run pytest execution, debugger
279270
}
280271
default: {
281272
throw new Error(`Unknown test provider '${testProvider}'`);

src/client/testing/testController/common/discoveryHelper.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/client/testing/testController/common/externalDependencies.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/client/testing/testController/common/resultsHelper.ts

Lines changed: 0 additions & 174 deletions
This file was deleted.

0 commit comments

Comments
 (0)