From d7ff7c5cf1f52445033361df3d97675e88490c71 Mon Sep 17 00:00:00 2001 From: Aidos Kanapyanov <65722512+aidoskanapyanov@users.noreply.github.com> Date: Wed, 19 Apr 2023 22:28:46 +0600 Subject: [PATCH 01/17] Default to `--no-cov` when debugging pytest (#21048) Resolve #19985. --- src/client/testing/testController/pytest/runner.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/testing/testController/pytest/runner.ts b/src/client/testing/testController/pytest/runner.ts index 2c6cff724398..83da819b861a 100644 --- a/src/client/testing/testController/pytest/runner.ts +++ b/src/client/testing/testController/pytest/runner.ts @@ -95,6 +95,10 @@ export class PytestRunner implements ITestsRunner { testArgs.push('--capture', 'no'); } + if (options.debug && !testArgs.some((a) => a.startsWith('--no-cov'))) { + testArgs.push('--no-cov'); + } + // Positional arguments control the tests to be run. const rawData = idToRawData.get(testNode.id); if (!rawData) { From 5d969cb636c1d798edea7b95e59ce63c71831105 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Wed, 19 Apr 2023 16:11:46 -0700 Subject: [PATCH 02/17] Deprecate python logging level setting (#21083) Deprecates the logging level setting. The default for logging level from VS Code is Info, so in this PR moved a few items to verbose so that we get the same logging experience. Closes https://github.com/microsoft/vscode-python/issues/20844 --- src/client/interpreter/activation/service.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/client/interpreter/activation/service.ts b/src/client/interpreter/activation/service.ts index e5da57227b19..0717b1474128 100644 --- a/src/client/interpreter/activation/service.ts +++ b/src/client/interpreter/activation/service.ts @@ -26,14 +26,7 @@ import { EventName } from '../../telemetry/constants'; import { IInterpreterService } from '../contracts'; import { IEnvironmentActivationService } from './types'; import { TraceOptions } from '../../logging/types'; -import { - traceDecoratorError, - traceDecoratorVerbose, - traceError, - traceInfo, - traceVerbose, - traceWarn, -} from '../../logging'; +import { traceDecoratorError, traceDecoratorVerbose, traceError, traceVerbose, traceWarn } from '../../logging'; import { Conda } from '../../pythonEnvironments/common/environmentManagers/conda'; import { StopWatch } from '../../common/utils/stopWatch'; import { identifyShellFromShellPath } from '../../common/terminal/shellDetectors/baseShellDetector'; @@ -302,7 +295,7 @@ export class EnvironmentActivationService implements IEnvironmentActivationServi // that's the case, wait and try again. This happens especially on AzDo const excString = (exc as Error).toString(); if (condaRetryMessages.find((m) => excString.includes(m)) && tryCount < 10) { - traceInfo(`Conda is busy, attempting to retry ...`); + traceVerbose(`Conda is busy, attempting to retry ...`); result = undefined; tryCount += 1; await sleep(500); From 82451b33b44f41c187932e3fc16be796abcef69e Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 17 Apr 2023 15:05:21 -0700 Subject: [PATCH 03/17] Use new logging API for python extension logger and LS logger (#21062) In this PR: 1. Changes the python extension logging to use LogOutputChannel 2. Changes the language server logger with LogOutputChannel 3. Test output channel uses OutputChannel as it needs to show test output and not really logging. Also, using logging test output makes it pretty much unreadable. 4. Simplifies logging channel and output channel registration. We need to do this now to make it easier for new test work to integrate with output logging. For #20844 This still doesn't get rid of the log level setting. --- src/test/activation/node/analysisOptions.unit.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/activation/node/analysisOptions.unit.test.ts b/src/test/activation/node/analysisOptions.unit.test.ts index d5e97f93768e..8d5d418c33ea 100644 --- a/src/test/activation/node/analysisOptions.unit.test.ts +++ b/src/test/activation/node/analysisOptions.unit.test.ts @@ -9,7 +9,7 @@ import { NodeLanguageServerAnalysisOptions } from '../../../client/activation/no import { ILanguageServerOutputChannel } from '../../../client/activation/types'; import { IWorkspaceService } from '../../../client/common/application/types'; import { PYTHON, PYTHON_LANGUAGE } from '../../../client/common/constants'; -import { ILogOutputChannel } from '../../../client/common/types'; +import { IExperimentService, ILogOutputChannel } from '../../../client/common/types'; suite('Pylance Language Server - Analysis Options', () => { class TestClass extends NodeLanguageServerAnalysisOptions { From 0aa470e21f8689ecc289fbfda941bfdf09428622 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Wed, 26 Apr 2023 16:39:08 -0700 Subject: [PATCH 04/17] Ensure microvenv is added to path after selection. (#21132) fixes https://github.com/microsoft/vscode-python/issues/21122 --- src/client/interpreter/activation/service.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/client/interpreter/activation/service.ts b/src/client/interpreter/activation/service.ts index 0717b1474128..e5da57227b19 100644 --- a/src/client/interpreter/activation/service.ts +++ b/src/client/interpreter/activation/service.ts @@ -26,7 +26,14 @@ import { EventName } from '../../telemetry/constants'; import { IInterpreterService } from '../contracts'; import { IEnvironmentActivationService } from './types'; import { TraceOptions } from '../../logging/types'; -import { traceDecoratorError, traceDecoratorVerbose, traceError, traceVerbose, traceWarn } from '../../logging'; +import { + traceDecoratorError, + traceDecoratorVerbose, + traceError, + traceInfo, + traceVerbose, + traceWarn, +} from '../../logging'; import { Conda } from '../../pythonEnvironments/common/environmentManagers/conda'; import { StopWatch } from '../../common/utils/stopWatch'; import { identifyShellFromShellPath } from '../../common/terminal/shellDetectors/baseShellDetector'; @@ -295,7 +302,7 @@ export class EnvironmentActivationService implements IEnvironmentActivationServi // that's the case, wait and try again. This happens especially on AzDo const excString = (exc as Error).toString(); if (condaRetryMessages.find((m) => excString.includes(m)) && tryCount < 10) { - traceVerbose(`Conda is busy, attempting to retry ...`); + traceInfo(`Conda is busy, attempting to retry ...`); result = undefined; tryCount += 1; await sleep(500); From 99fc82fdb895a036ae3f764afa8b2408e1c8afe0 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 1 May 2023 09:08:44 -0700 Subject: [PATCH 05/17] Revert "Default to `--no-cov` when debugging pytest" (#21152) Reverts microsoft/vscode-python#21048 Closes https://github.com/microsoft/vscode-python/issues/21146 Related https://github.com/microsoft/vscode-python/issues/19985 --- src/client/testing/testController/pytest/runner.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/client/testing/testController/pytest/runner.ts b/src/client/testing/testController/pytest/runner.ts index 83da819b861a..2c6cff724398 100644 --- a/src/client/testing/testController/pytest/runner.ts +++ b/src/client/testing/testController/pytest/runner.ts @@ -95,10 +95,6 @@ export class PytestRunner implements ITestsRunner { testArgs.push('--capture', 'no'); } - if (options.debug && !testArgs.some((a) => a.startsWith('--no-cov'))) { - testArgs.push('--no-cov'); - } - // Positional arguments control the tests to be run. const rawData = idToRawData.get(testNode.id); if (!rawData) { From 0fbe07564a9441198f1511bb6e7e6d93728c95a8 Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Thu, 20 Apr 2023 15:56:21 -0700 Subject: [PATCH 06/17] enable debug for pytest --- .vscode/launch.json | 3 ++- pythonFiles/vscode_pytest/__init__.py | 9 +++++-- .../common/process/internal/scripts/index.ts | 7 +++++ src/client/testing/common/debugLauncher.ts | 27 +++++++++++++++---- .../testing/testController/common/types.ts | 3 ++- .../testing/testController/controller.ts | 1 + .../pytest/pytestExecutionAdapter.ts | 27 +++++++++++++++---- .../testController/workspaceTestAdapter.ts | 3 +++ 8 files changed, 66 insertions(+), 14 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 82981a93305d..1ca0db3dc858 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -22,7 +22,8 @@ // Enable this to log telemetry to the output during debugging "XVSC_PYTHON_LOG_TELEMETRY": "1", // Enable this to log debugger output. Directory must exist ahead of time - "XDEBUGPY_LOG_DIR": "${workspaceRoot}/tmp/Debug_Output_Ex" + "XDEBUGPY_LOG_DIR": "${workspaceRoot}/tmp/Debug_Output_Ex", + "ENABLE_PYTHON_TESTING_REWRITE": "1" } }, { diff --git a/pythonFiles/vscode_pytest/__init__.py b/pythonFiles/vscode_pytest/__init__.py index 6063e4113d55..fd270cb5ed58 100644 --- a/pythonFiles/vscode_pytest/__init__.py +++ b/pythonFiles/vscode_pytest/__init__.py @@ -448,7 +448,9 @@ def execution_post( if s.socket is not None: s.socket.sendall(request.encode("utf-8")) except Exception as e: - print(f"Plugin error connection error[vscode-pytest]: {e}") + print( + f"Plugin error connection error[vscode-pytest]: {e}, port: {testPort}" + ) print(f"[vscode-pytest] data: {request}") @@ -488,5 +490,8 @@ def post_response(cwd: str, session_node: TestNode) -> None: if s.socket is not None: s.socket.sendall(request.encode("utf-8")) except Exception as e: - print(f"Plugin error connection error[vscode-pytest]: {e}") + print( + f"Plugin!! error connection error[vscode-pytest]: {e}, port: {testPort}" + ) print(f"[vscode-pytest] data: {request}") + print(f"attempted port: {testPort}") diff --git a/src/client/common/process/internal/scripts/index.ts b/src/client/common/process/internal/scripts/index.ts index c52983d9910b..343e67e3be70 100644 --- a/src/client/common/process/internal/scripts/index.ts +++ b/src/client/common/process/internal/scripts/index.ts @@ -126,6 +126,13 @@ export function execution_py_testlauncher(testArgs: string[]): string[] { return [script, ...testArgs]; } +// execution.py +// eslint-disable-next-line camelcase +export function execution_pytest_testlauncher(testArgs: string[]): string[] { + // const script = path.join(SCRIPTS_DIR, 'unittestadapter', 'execution.py'); + return ['/opt/homebrew/bin/python3', ...testArgs]; +} + // tensorboard_launcher.py export function tensorboardLauncher(args: string[]): string[] { diff --git a/src/client/testing/common/debugLauncher.ts b/src/client/testing/common/debugLauncher.ts index 36432c0bd831..fcba49c7f096 100644 --- a/src/client/testing/common/debugLauncher.ts +++ b/src/client/testing/common/debugLauncher.ts @@ -88,7 +88,7 @@ export class DebugLauncher implements ITestDebugLauncher { } debugConfig.rules.push({ path: path.join(EXTENSION_ROOT_DIR, 'pythonFiles'), - include: false, + include: true, }); DebugLauncher.applyDefaults(debugConfig!, workspaceFolder, configSettings); @@ -180,7 +180,10 @@ export class DebugLauncher implements ITestDebugLauncher { const script = DebugLauncher.getTestLauncherScript(options.testProvider); const args = script(testArgs); const [program] = args; - configArgs.program = program; + console.debug(`Test launch: ${program} ${args.slice(1).join(' ')}`); + + configArgs.module = 'pytest'; + configArgs.program = undefined; configArgs.args = args.slice(1); // We leave configArgs.request as "test" so it will be sent in telemetry. @@ -201,6 +204,19 @@ export class DebugLauncher implements ITestDebugLauncher { throw Error(`Invalid debug config "${debugConfig.name}"`); } launchArgs.request = 'launch'; + const p = path.join(EXTENSION_ROOT_DIR, 'pythonFiles'); + if (launchArgs.env) { + launchArgs.env.PYTHONPATH = p; + if (launchArgs.args) { + if (launchArgs.args.includes('--port')) { + const index = launchArgs.args.indexOf('--port'); + const port = launchArgs.args[index + 1]; + launchArgs.env.TEST_PORT = port.toString(); + launchArgs.args.splice(index, 2); + // delete launchArgs.args[index + 1] + } + } + } // Clear out purpose so we can detect if the configuration was used to // run via F5 style debugging. @@ -212,11 +228,12 @@ export class DebugLauncher implements ITestDebugLauncher { private static getTestLauncherScript(testProvider: TestProvider) { switch (testProvider) { case 'unittest': { - return internalScripts.visualstudio_py_testlauncher; // old way unittest execution, debugger - // return internalScripts.execution_py_testlauncher; // this is the new way to run unittest execution, debugger + // return internalScripts.visualstudio_py_testlauncher; // old way unittest execution, debugger + return internalScripts.execution_py_testlauncher; // this is the new way to run unittest execution, debugger } case 'pytest': { - return internalScripts.testlauncher; + // return internalScripts.shell_exec; + return internalScripts.execution_pytest_testlauncher; } default: { throw new Error(`Unknown test provider '${testProvider}'`); diff --git a/src/client/testing/testController/common/types.ts b/src/client/testing/testController/common/types.ts index 52c6c787040c..4336fee3a4b6 100644 --- a/src/client/testing/testController/common/types.ts +++ b/src/client/testing/testController/common/types.ts @@ -12,7 +12,7 @@ import { Uri, WorkspaceFolder, } from 'vscode'; -import { TestDiscoveryOptions } from '../../common/types'; +import { ITestDebugLauncher, TestDiscoveryOptions } from '../../common/types'; import { IPythonExecutionFactory } from '../../../common/process/types'; export type TestRunInstanceOptions = TestRunOptions & { @@ -193,6 +193,7 @@ export interface ITestExecutionAdapter { testIds: string[], debugBool?: boolean, executionFactory?: IPythonExecutionFactory, + debugLauncher?: ITestDebugLauncher, ): Promise; } diff --git a/src/client/testing/testController/controller.ts b/src/client/testing/testController/controller.ts index fb176a30af88..a46d7bd71242 100644 --- a/src/client/testing/testController/controller.ts +++ b/src/client/testing/testController/controller.ts @@ -409,6 +409,7 @@ export class PythonTestController implements ITestController, IExtensionSingleAc token, request.profile?.kind === TestRunProfileKind.Debug, this.pythonExecFactory, + this.debugLauncher, ); } return this.pytest.runTests( diff --git a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts index d2cbd3151e6f..96b6a4c2908e 100644 --- a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts +++ b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts @@ -14,6 +14,8 @@ import { } from '../../../common/process/types'; import { EXTENSION_ROOT_DIR } from '../../../constants'; import { removePositionalFoldersAndFiles } from './arguments'; +import { ITestDebugLauncher, LaunchOptions } from '../../common/types'; +import { PYTEST_PROVIDER } from '../../common/constants'; // eslint-disable-next-line @typescript-eslint/no-explicit-any (global as any).EXTENSION_ROOT_DIR = EXTENSION_ROOT_DIR; @@ -47,11 +49,12 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter { testIds: string[], debugBool?: boolean, executionFactory?: IPythonExecutionFactory, + debugLauncher?: ITestDebugLauncher, ): Promise { traceVerbose(uri, testIds, debugBool); if (executionFactory !== undefined) { // ** new version of run tests. - return this.runTestsNew(uri, testIds, debugBool, executionFactory); + return this.runTestsNew(uri, testIds, debugBool, executionFactory, debugLauncher); } // if executionFactory is undefined, we are using the old method signature of run tests. this.outputChannel.appendLine('Running tests.'); @@ -64,6 +67,7 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter { testIds: string[], debugBool?: boolean, executionFactory?: IPythonExecutionFactory, + debugLauncher?: ITestDebugLauncher, ): Promise { const deferred = createDeferred(); const relativePathToPytest = 'pythonFiles'; @@ -112,10 +116,23 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter { console.debug(`Running test with arguments: ${testArgs.join(' ')}\r\n`); console.debug(`Current working directory: ${uri.fsPath}\r\n`); - - const argArray = ['-m', 'pytest', '-p', 'vscode_pytest'].concat(testArgs).concat(testIds); - console.debug('argArray', argArray); - execService?.exec(argArray, spawnOptions); + // const portString = `--port= ${this.testServer.getPort().toString()}`; + const finalArgs = ['-m', 'pytest', '-p', 'vscode_pytest'].concat(testArgs).concat(testIds); + console.debug('argArray', finalArgs); + // const finalArgs = ['-m', 'pytest', '-p', 'vscode_pytest', testIdsString].concat(pytestArgs); + if (debugBool) { + const debugArgs = finalArgs.concat(['--port', this.testServer.getPort().toString()]); + const launchOptions: LaunchOptions = { + cwd: uri.fsPath, + args: debugArgs, + token: spawnOptions.token, + testProvider: PYTEST_PROVIDER, + }; + + await debugLauncher!.launchDebugger(launchOptions); + } else { + execService?.exec(finalArgs, spawnOptions); + } } catch (ex) { console.debug(`Error while running tests: ${testIds}\r\n${ex}\r\n\r\n`); return Promise.reject(ex); diff --git a/src/client/testing/testController/workspaceTestAdapter.ts b/src/client/testing/testController/workspaceTestAdapter.ts index 39efc67f7c7e..b22fee69d295 100644 --- a/src/client/testing/testController/workspaceTestAdapter.ts +++ b/src/client/testing/testController/workspaceTestAdapter.ts @@ -38,6 +38,7 @@ import { } from './common/types'; import { fixLogLines } from './common/utils'; import { IPythonExecutionFactory } from '../../common/process/types'; +import { ITestDebugLauncher } from '../common/types'; /** * This class exposes a test-provider-agnostic way of discovering tests. @@ -77,6 +78,7 @@ export class WorkspaceTestAdapter { token?: CancellationToken, debugBool?: boolean, executionFactory?: IPythonExecutionFactory, + debugLauncher?: ITestDebugLauncher, ): Promise { if (this.executing) { return this.executing.promise; @@ -110,6 +112,7 @@ export class WorkspaceTestAdapter { testCaseIds, debugBool, executionFactory, + debugLauncher, ); traceVerbose('executionFactory defined'); } else { From 3b02b9c029c89c6077dce478cfabfb6aea461763 Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Thu, 11 May 2023 14:55:15 -0700 Subject: [PATCH 07/17] getting unittest working again --- src/client/testing/common/debugLauncher.ts | 31 +++++++++++-------- .../testing/testController/controller.ts | 1 + .../pytest/pytestExecutionAdapter.ts | 6 ++-- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/client/testing/common/debugLauncher.ts b/src/client/testing/common/debugLauncher.ts index fcba49c7f096..a488780eff7d 100644 --- a/src/client/testing/common/debugLauncher.ts +++ b/src/client/testing/common/debugLauncher.ts @@ -88,7 +88,7 @@ export class DebugLauncher implements ITestDebugLauncher { } debugConfig.rules.push({ path: path.join(EXTENSION_ROOT_DIR, 'pythonFiles'), - include: true, + include: false, }); DebugLauncher.applyDefaults(debugConfig!, workspaceFolder, configSettings); @@ -180,10 +180,13 @@ export class DebugLauncher implements ITestDebugLauncher { const script = DebugLauncher.getTestLauncherScript(options.testProvider); const args = script(testArgs); const [program] = args; + configArgs.program = program; console.debug(`Test launch: ${program} ${args.slice(1).join(' ')}`); - configArgs.module = 'pytest'; - configArgs.program = undefined; + if (options.testProvider === 'pytest') { + configArgs.module = 'pytest'; + configArgs.program = undefined; + } configArgs.args = args.slice(1); // We leave configArgs.request as "test" so it will be sent in telemetry. @@ -204,16 +207,18 @@ export class DebugLauncher implements ITestDebugLauncher { throw Error(`Invalid debug config "${debugConfig.name}"`); } launchArgs.request = 'launch'; - const p = path.join(EXTENSION_ROOT_DIR, 'pythonFiles'); - if (launchArgs.env) { - launchArgs.env.PYTHONPATH = p; - if (launchArgs.args) { - if (launchArgs.args.includes('--port')) { - const index = launchArgs.args.indexOf('--port'); - const port = launchArgs.args[index + 1]; - launchArgs.env.TEST_PORT = port.toString(); - launchArgs.args.splice(index, 2); - // delete launchArgs.args[index + 1] + if (options.testProvider === 'pytest') { + const p = path.join(EXTENSION_ROOT_DIR, 'pythonFiles'); + if (launchArgs.env) { + launchArgs.env.PYTHONPATH = p; + if (launchArgs.args) { + if (launchArgs.args.includes('--port')) { + const index = launchArgs.args.indexOf('--port'); + const port = launchArgs.args[index + 1]; + launchArgs.env.TEST_PORT = port.toString(); + launchArgs.args.splice(index, 2); + // delete launchArgs.args[index + 1] + } } } } diff --git a/src/client/testing/testController/controller.ts b/src/client/testing/testController/controller.ts index a46d7bd71242..58eaa9c890d6 100644 --- a/src/client/testing/testController/controller.ts +++ b/src/client/testing/testController/controller.ts @@ -439,6 +439,7 @@ export class PythonTestController implements ITestController, IExtensionSingleAc testItems, token, request.profile?.kind === TestRunProfileKind.Debug, + this.pythonExecFactory, ); } // below is old way of running unittest execution diff --git a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts index 96b6a4c2908e..802e764857cf 100644 --- a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts +++ b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts @@ -110,9 +110,9 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter { testArgs.splice(0, 0, '--rootdir', uri.fsPath); } - if (debugBool && !testArgs.some((a) => a.startsWith('--capture') || a === '-s')) { - testArgs.push('--capture', 'no'); - } + // if (debugBool && !testArgs.some((a) => a.startsWith('--capture') || a === '-s')) { + // testArgs.push('--capture', 'no'); + // } console.debug(`Running test with arguments: ${testArgs.join(' ')}\r\n`); console.debug(`Current working directory: ${uri.fsPath}\r\n`); From 391e7274955f344d1ab1c7d9acc25263e747f960 Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Thu, 11 May 2023 15:09:06 -0700 Subject: [PATCH 08/17] hitting the breakpoint! --- src/client/testing/common/debugLauncher.ts | 1 + .../testing/testController/pytest/pytestExecutionAdapter.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/testing/common/debugLauncher.ts b/src/client/testing/common/debugLauncher.ts index a488780eff7d..7cd33889a684 100644 --- a/src/client/testing/common/debugLauncher.ts +++ b/src/client/testing/common/debugLauncher.ts @@ -212,6 +212,7 @@ export class DebugLauncher implements ITestDebugLauncher { if (launchArgs.env) { launchArgs.env.PYTHONPATH = p; if (launchArgs.args) { + launchArgs.args.splice(0, 2); if (launchArgs.args.includes('--port')) { const index = launchArgs.args.indexOf('--port'); const port = launchArgs.args[index + 1]; diff --git a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts index 802e764857cf..c24a690fc7bd 100644 --- a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts +++ b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts @@ -117,7 +117,7 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter { console.debug(`Running test with arguments: ${testArgs.join(' ')}\r\n`); console.debug(`Current working directory: ${uri.fsPath}\r\n`); // const portString = `--port= ${this.testServer.getPort().toString()}`; - const finalArgs = ['-m', 'pytest', '-p', 'vscode_pytest'].concat(testArgs).concat(testIds); + const finalArgs = ['-m', 'pytest', '-p', 'vscode_pytest', '-v'].concat(testArgs).concat(testIds); console.debug('argArray', finalArgs); // const finalArgs = ['-m', 'pytest', '-p', 'vscode_pytest', testIdsString].concat(pytestArgs); if (debugBool) { From 9ff1d7deda4348f096e5279f536c13ba9baa4516 Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Thu, 11 May 2023 15:24:33 -0700 Subject: [PATCH 09/17] working debugging for pytest --- pythonFiles/vscode_pytest/__init__.py | 2 ++ src/client/testing/common/debugLauncher.ts | 7 ++++++- .../testController/pytest/pytestExecutionAdapter.ts | 7 ++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pythonFiles/vscode_pytest/__init__.py b/pythonFiles/vscode_pytest/__init__.py index fd270cb5ed58..a31c217c80da 100644 --- a/pythonFiles/vscode_pytest/__init__.py +++ b/pythonFiles/vscode_pytest/__init__.py @@ -446,6 +446,8 @@ def execution_post( try: with socket_manager.SocketManager(addr) as s: if s.socket is not None: + print(f"Sending msg response to server port: {testPort}") + print(f"data being sent: {request}") s.socket.sendall(request.encode("utf-8")) except Exception as e: print( diff --git a/src/client/testing/common/debugLauncher.ts b/src/client/testing/common/debugLauncher.ts index 7cd33889a684..9f8e6e448a09 100644 --- a/src/client/testing/common/debugLauncher.ts +++ b/src/client/testing/common/debugLauncher.ts @@ -218,7 +218,12 @@ export class DebugLauncher implements ITestDebugLauncher { const port = launchArgs.args[index + 1]; launchArgs.env.TEST_PORT = port.toString(); launchArgs.args.splice(index, 2); - // delete launchArgs.args[index + 1] + } + if (launchArgs.args.includes('--uuid')) { + const index = launchArgs.args.indexOf('--uuid'); + const uuid = launchArgs.args[index + 1]; + launchArgs.env.TEST_UUID = uuid.toString(); + launchArgs.args.splice(index, 2); } } } diff --git a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts index c24a690fc7bd..f4082e23a002 100644 --- a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts +++ b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts @@ -121,7 +121,12 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter { console.debug('argArray', finalArgs); // const finalArgs = ['-m', 'pytest', '-p', 'vscode_pytest', testIdsString].concat(pytestArgs); if (debugBool) { - const debugArgs = finalArgs.concat(['--port', this.testServer.getPort().toString()]); + const debugArgs = finalArgs.concat([ + '--port', + this.testServer.getPort().toString(), + '--uuid', + uuid.toString(), + ]); const launchOptions: LaunchOptions = { cwd: uri.fsPath, args: debugArgs, From 481dad01f14e2843b2f978902236fde51f4ecfa1 Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Thu, 11 May 2023 15:43:49 -0700 Subject: [PATCH 10/17] update launchOptions to include port and uuid --- src/client/testing/common/debugLauncher.ts | 20 ++++++++----------- src/client/testing/common/types.ts | 2 ++ .../pytest/pytestExecutionAdapter.ts | 12 +++++------ 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/client/testing/common/debugLauncher.ts b/src/client/testing/common/debugLauncher.ts index 9f8e6e448a09..17a7def889af 100644 --- a/src/client/testing/common/debugLauncher.ts +++ b/src/client/testing/common/debugLauncher.ts @@ -208,23 +208,19 @@ export class DebugLauncher implements ITestDebugLauncher { } launchArgs.request = 'launch'; if (options.testProvider === 'pytest') { + if (options.pytestPort && options.pytestUUID) { + launchArgs.env = { + ...launchArgs.env, + TEST_PORT: options.pytestPort, + TEST_UUID: options.pytestUUID, + }; + } const p = path.join(EXTENSION_ROOT_DIR, 'pythonFiles'); if (launchArgs.env) { launchArgs.env.PYTHONPATH = p; if (launchArgs.args) { + // cut -m and pytest from the args, these are not needed in debug launchArgs.args.splice(0, 2); - if (launchArgs.args.includes('--port')) { - const index = launchArgs.args.indexOf('--port'); - const port = launchArgs.args[index + 1]; - launchArgs.env.TEST_PORT = port.toString(); - launchArgs.args.splice(index, 2); - } - if (launchArgs.args.includes('--uuid')) { - const index = launchArgs.args.indexOf('--uuid'); - const uuid = launchArgs.args[index + 1]; - launchArgs.env.TEST_UUID = uuid.toString(); - launchArgs.args.splice(index, 2); - } } } } diff --git a/src/client/testing/common/types.ts b/src/client/testing/common/types.ts index b1476e74435f..a5d263058525 100644 --- a/src/client/testing/common/types.ts +++ b/src/client/testing/common/types.ts @@ -25,6 +25,8 @@ export type LaunchOptions = { testProvider: TestProvider; token?: CancellationToken; outChannel?: OutputChannel; + pytestPort?: string; + pytestUUID?: string; }; export type ParserOptions = TestDiscoveryOptions; diff --git a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts index f4082e23a002..3526448136b7 100644 --- a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts +++ b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts @@ -121,17 +121,15 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter { console.debug('argArray', finalArgs); // const finalArgs = ['-m', 'pytest', '-p', 'vscode_pytest', testIdsString].concat(pytestArgs); if (debugBool) { - const debugArgs = finalArgs.concat([ - '--port', - this.testServer.getPort().toString(), - '--uuid', - uuid.toString(), - ]); + const pytestPort = this.testServer.getPort().toString(); + const pytestUUID = uuid.toString(); const launchOptions: LaunchOptions = { cwd: uri.fsPath, - args: debugArgs, + args: finalArgs, token: spawnOptions.token, testProvider: PYTEST_PROVIDER, + pytestPort, + pytestUUID, }; await debugLauncher!.launchDebugger(launchOptions); From ac633c7f447a7d45c5b05b7d50d015f1beaf51ef Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Fri, 12 May 2023 09:39:16 -0700 Subject: [PATCH 11/17] fixing debug msg --- pythonFiles/vscode_pytest/__init__.py | 7 +++++- src/client/testing/common/debugLauncher.ts | 14 +++++------ .../pytest/pytestExecutionAdapter.ts | 23 ++++++++----------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pythonFiles/vscode_pytest/__init__.py b/pythonFiles/vscode_pytest/__init__.py index a31c217c80da..6f7ad980df2d 100644 --- a/pythonFiles/vscode_pytest/__init__.py +++ b/pythonFiles/vscode_pytest/__init__.py @@ -179,6 +179,12 @@ def pytest_sessionfinish(session, exitstatus): 4: Pytest encountered an internal error or exception during test execution. 5: Pytest was unable to find any tests to run. """ + print( + "pytest session has finished, exit status: ", + exitstatus, + "in discovery? ", + IS_DISCOVERY, + ) cwd = pathlib.Path.cwd() if IS_DISCOVERY: try: @@ -209,7 +215,6 @@ def pytest_sessionfinish(session, exitstatus): f"Pytest exited with error status: {exitstatus}, {ERROR_MESSAGE_CONST[exitstatus]}" ) exitstatus_bool = "error" - execution_post( os.fsdecode(cwd), exitstatus_bool, diff --git a/src/client/testing/common/debugLauncher.ts b/src/client/testing/common/debugLauncher.ts index 17a7def889af..3c09375346be 100644 --- a/src/client/testing/common/debugLauncher.ts +++ b/src/client/testing/common/debugLauncher.ts @@ -214,15 +214,13 @@ export class DebugLauncher implements ITestDebugLauncher { TEST_PORT: options.pytestPort, TEST_UUID: options.pytestUUID, }; + } else { + throw Error( + `Missing value for debug setup, both port and uuid need to be defined. port: "${options.pytestPort}" uuid: "${options.pytestUUID}"`, + ); } - const p = path.join(EXTENSION_ROOT_DIR, 'pythonFiles'); - if (launchArgs.env) { - launchArgs.env.PYTHONPATH = p; - if (launchArgs.args) { - // cut -m and pytest from the args, these are not needed in debug - launchArgs.args.splice(0, 2); - } - } + const pluginPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles'); + launchArgs.env.PYTHONPATH = pluginPath; } // Clear out purpose so we can detect if the configuration was used to diff --git a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts index 3526448136b7..4dfdacbbd86f 100644 --- a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts +++ b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts @@ -110,31 +110,28 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter { testArgs.splice(0, 0, '--rootdir', uri.fsPath); } - // if (debugBool && !testArgs.some((a) => a.startsWith('--capture') || a === '-s')) { - // testArgs.push('--capture', 'no'); - // } - - console.debug(`Running test with arguments: ${testArgs.join(' ')}\r\n`); - console.debug(`Current working directory: ${uri.fsPath}\r\n`); - // const portString = `--port= ${this.testServer.getPort().toString()}`; - const finalArgs = ['-m', 'pytest', '-p', 'vscode_pytest', '-v'].concat(testArgs).concat(testIds); - console.debug('argArray', finalArgs); - // const finalArgs = ['-m', 'pytest', '-p', 'vscode_pytest', testIdsString].concat(pytestArgs); + // why is this needed? + if (debugBool && !testArgs.some((a) => a.startsWith('--capture') || a === '-s')) { + testArgs.push('--capture', 'no'); + } + const pluginArgs = ['-p', 'vscode_pytest', '-v'].concat(testArgs).concat(testIds); if (debugBool) { const pytestPort = this.testServer.getPort().toString(); const pytestUUID = uuid.toString(); const launchOptions: LaunchOptions = { cwd: uri.fsPath, - args: finalArgs, + args: pluginArgs, token: spawnOptions.token, testProvider: PYTEST_PROVIDER, pytestPort, pytestUUID, }; - + console.debug(`Running debug test with arguments: ${pluginArgs.join(' ')}\r\n`); await debugLauncher!.launchDebugger(launchOptions); } else { - execService?.exec(finalArgs, spawnOptions); + const runArgs = ['-m', 'pytest'].concat(pluginArgs); + console.debug(`Running test with arguments: ${runArgs.join(' ')}\r\n`); + execService?.exec(runArgs, spawnOptions); } } catch (ex) { console.debug(`Error while running tests: ${testIds}\r\n${ex}\r\n\r\n`); From 6e218f3d5f960060dfd71fe7bab69d3bb18c051e Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Fri, 12 May 2023 09:42:31 -0700 Subject: [PATCH 12/17] fix resolvers on terminate debug session --- src/client/testing/common/debugLauncher.ts | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/client/testing/common/debugLauncher.ts b/src/client/testing/common/debugLauncher.ts index 3c09375346be..dc6d3fbe9c64 100644 --- a/src/client/testing/common/debugLauncher.ts +++ b/src/client/testing/common/debugLauncher.ts @@ -15,6 +15,7 @@ import { ITestDebugLauncher, LaunchOptions } from './types'; import { getConfigurationsForWorkspace } from '../../debugger/extension/configuration/launch.json/launchJsonReader'; import { getWorkspaceFolder, getWorkspaceFolders } from '../../common/vscodeApis/workspaceApis'; import { showErrorMessage } from '../../common/vscodeApis/windowApis'; +import { createDeferred } from '../../common/utils/async'; @injectable() export class DebugLauncher implements ITestDebugLauncher { @@ -42,16 +43,12 @@ export class DebugLauncher implements ITestDebugLauncher { ); const debugManager = this.serviceContainer.get(IDebugService); - return debugManager.startDebugging(workspaceFolder, launchArgs).then( - // Wait for debug session to be complete. - () => - new Promise((resolve) => { - debugManager.onDidTerminateDebugSession(() => { - resolve(); - }); - }), - (ex) => traceError('Failed to start debugging tests', ex), - ); + const deferred = createDeferred(); + debugManager.onDidTerminateDebugSession(() => { + deferred.resolve(); + }); + debugManager.startDebugging(workspaceFolder, launchArgs); + return deferred.promise; } private static resolveWorkspaceFolder(cwd: string): WorkspaceFolder { @@ -181,8 +178,7 @@ export class DebugLauncher implements ITestDebugLauncher { const args = script(testArgs); const [program] = args; configArgs.program = program; - console.debug(`Test launch: ${program} ${args.slice(1).join(' ')}`); - + // if the test provider is pytest, then use the pytest module instead of using a program if (options.testProvider === 'pytest') { configArgs.module = 'pytest'; configArgs.program = undefined; From b8c14fec0170051f618799c1bc06671f0cf052b3 Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Fri, 12 May 2023 09:43:58 -0700 Subject: [PATCH 13/17] remove extra prints --- pythonFiles/vscode_pytest/__init__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pythonFiles/vscode_pytest/__init__.py b/pythonFiles/vscode_pytest/__init__.py index 6f7ad980df2d..472721af290c 100644 --- a/pythonFiles/vscode_pytest/__init__.py +++ b/pythonFiles/vscode_pytest/__init__.py @@ -451,13 +451,9 @@ def execution_post( try: with socket_manager.SocketManager(addr) as s: if s.socket is not None: - print(f"Sending msg response to server port: {testPort}") - print(f"data being sent: {request}") s.socket.sendall(request.encode("utf-8")) except Exception as e: - print( - f"Plugin error connection error[vscode-pytest]: {e}, port: {testPort}" - ) + print(f"Plugin error connection error[vscode-pytest]: {e}") print(f"[vscode-pytest] data: {request}") From 8cbf42abf9986400ecc6c62028baf7d46a922405 Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Fri, 12 May 2023 10:06:54 -0700 Subject: [PATCH 14/17] add rewrite env var --- .vscode/launch.json | 2 +- pythonFiles/vscode_pytest/__init__.py | 1 - .../common/process/internal/scripts/index.ts | 1 - src/client/testing/common/debugLauncher.ts | 18 ++++++++++++------ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 1ca0db3dc858..16c8c089db49 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -23,7 +23,7 @@ "XVSC_PYTHON_LOG_TELEMETRY": "1", // Enable this to log debugger output. Directory must exist ahead of time "XDEBUGPY_LOG_DIR": "${workspaceRoot}/tmp/Debug_Output_Ex", - "ENABLE_PYTHON_TESTING_REWRITE": "1" + // "ENABLE_PYTHON_TESTING_REWRITE": "1" } }, { diff --git a/pythonFiles/vscode_pytest/__init__.py b/pythonFiles/vscode_pytest/__init__.py index 472721af290c..2a9adc5ad518 100644 --- a/pythonFiles/vscode_pytest/__init__.py +++ b/pythonFiles/vscode_pytest/__init__.py @@ -497,4 +497,3 @@ def post_response(cwd: str, session_node: TestNode) -> None: f"Plugin!! error connection error[vscode-pytest]: {e}, port: {testPort}" ) print(f"[vscode-pytest] data: {request}") - print(f"attempted port: {testPort}") diff --git a/src/client/common/process/internal/scripts/index.ts b/src/client/common/process/internal/scripts/index.ts index 343e67e3be70..92ef8c18a1ed 100644 --- a/src/client/common/process/internal/scripts/index.ts +++ b/src/client/common/process/internal/scripts/index.ts @@ -126,7 +126,6 @@ export function execution_py_testlauncher(testArgs: string[]): string[] { return [script, ...testArgs]; } -// execution.py // eslint-disable-next-line camelcase export function execution_pytest_testlauncher(testArgs: string[]): string[] { // const script = path.join(SCRIPTS_DIR, 'unittestadapter', 'execution.py'); diff --git a/src/client/testing/common/debugLauncher.ts b/src/client/testing/common/debugLauncher.ts index dc6d3fbe9c64..72a3ba26f564 100644 --- a/src/client/testing/common/debugLauncher.ts +++ b/src/client/testing/common/debugLauncher.ts @@ -179,7 +179,8 @@ export class DebugLauncher implements ITestDebugLauncher { const [program] = args; configArgs.program = program; // if the test provider is pytest, then use the pytest module instead of using a program - if (options.testProvider === 'pytest') { + const rewriteTestingEnabled = process.env.ENABLE_PYTHON_TESTING_REWRITE; + if (options.testProvider === 'pytest' && rewriteTestingEnabled) { configArgs.module = 'pytest'; configArgs.program = undefined; } @@ -203,7 +204,7 @@ export class DebugLauncher implements ITestDebugLauncher { throw Error(`Invalid debug config "${debugConfig.name}"`); } launchArgs.request = 'launch'; - if (options.testProvider === 'pytest') { + if (options.testProvider === 'pytest' && rewriteTestingEnabled) { if (options.pytestPort && options.pytestUUID) { launchArgs.env = { ...launchArgs.env, @@ -227,14 +228,19 @@ export class DebugLauncher implements ITestDebugLauncher { } private static getTestLauncherScript(testProvider: TestProvider) { + const rewriteTestingEnabled = process.env.ENABLE_PYTHON_TESTING_REWRITE; switch (testProvider) { case 'unittest': { - // return internalScripts.visualstudio_py_testlauncher; // old way unittest execution, debugger - return internalScripts.execution_py_testlauncher; // this is the new way to run unittest execution, debugger + if (rewriteTestingEnabled) { + return internalScripts.execution_py_testlauncher; // this is the new way to run unittest execution, debugger + } + return internalScripts.visualstudio_py_testlauncher; // old way unittest execution, debugger } case 'pytest': { - // return internalScripts.shell_exec; - return internalScripts.execution_pytest_testlauncher; + if (rewriteTestingEnabled) { + return internalScripts.execution_pytest_testlauncher; // this is the new way to run pytest execution, debugger + } + return internalScripts.testlauncher; // old way pytest execution, debugger } default: { throw new Error(`Unknown test provider '${testProvider}'`); From 4570598c3965b2b0252ba6f0ef20bc9956e5dabe Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Fri, 12 May 2023 12:15:03 -0700 Subject: [PATCH 15/17] Fixing python path --- .vscode/launch.json | 2 +- src/client/common/process/internal/scripts/index.ts | 6 ------ src/client/testing/common/debugLauncher.ts | 2 +- .../testing/testController/pytest/pytestExecutionAdapter.ts | 4 ++-- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 16c8c089db49..1ca0db3dc858 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -23,7 +23,7 @@ "XVSC_PYTHON_LOG_TELEMETRY": "1", // Enable this to log debugger output. Directory must exist ahead of time "XDEBUGPY_LOG_DIR": "${workspaceRoot}/tmp/Debug_Output_Ex", - // "ENABLE_PYTHON_TESTING_REWRITE": "1" + "ENABLE_PYTHON_TESTING_REWRITE": "1" } }, { diff --git a/src/client/common/process/internal/scripts/index.ts b/src/client/common/process/internal/scripts/index.ts index 92ef8c18a1ed..c52983d9910b 100644 --- a/src/client/common/process/internal/scripts/index.ts +++ b/src/client/common/process/internal/scripts/index.ts @@ -126,12 +126,6 @@ export function execution_py_testlauncher(testArgs: string[]): string[] { return [script, ...testArgs]; } -// eslint-disable-next-line camelcase -export function execution_pytest_testlauncher(testArgs: string[]): string[] { - // const script = path.join(SCRIPTS_DIR, 'unittestadapter', 'execution.py'); - return ['/opt/homebrew/bin/python3', ...testArgs]; -} - // tensorboard_launcher.py export function tensorboardLauncher(args: string[]): string[] { diff --git a/src/client/testing/common/debugLauncher.ts b/src/client/testing/common/debugLauncher.ts index 72a3ba26f564..5b39bd97a740 100644 --- a/src/client/testing/common/debugLauncher.ts +++ b/src/client/testing/common/debugLauncher.ts @@ -238,7 +238,7 @@ export class DebugLauncher implements ITestDebugLauncher { } case 'pytest': { if (rewriteTestingEnabled) { - return internalScripts.execution_pytest_testlauncher; // this is the new way to run pytest execution, debugger + return (testArgs: string[]) => testArgs; } return internalScripts.testlauncher; // old way pytest execution, debugger } diff --git a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts index 4dfdacbbd86f..623fd1ff3a8c 100644 --- a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts +++ b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts @@ -12,13 +12,13 @@ import { IPythonExecutionFactory, SpawnOptions, } from '../../../common/process/types'; -import { EXTENSION_ROOT_DIR } from '../../../constants'; import { removePositionalFoldersAndFiles } from './arguments'; import { ITestDebugLauncher, LaunchOptions } from '../../common/types'; import { PYTEST_PROVIDER } from '../../common/constants'; +import { EXTENSION_ROOT_DIR } from '../../../common/constants'; // eslint-disable-next-line @typescript-eslint/no-explicit-any -(global as any).EXTENSION_ROOT_DIR = EXTENSION_ROOT_DIR; +// (global as any).EXTENSION_ROOT_DIR = EXTENSION_ROOT_DIR; /** * Wrapper Class for pytest test execution. This is where we call `runTestCommand`? */ From 0458c1fb4a654fd975cb7e82920d51738bd5cf2a Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Fri, 12 May 2023 12:45:04 -0700 Subject: [PATCH 16/17] fixing error from before --- src/test/activation/node/analysisOptions.unit.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/activation/node/analysisOptions.unit.test.ts b/src/test/activation/node/analysisOptions.unit.test.ts index 8d5d418c33ea..d5e97f93768e 100644 --- a/src/test/activation/node/analysisOptions.unit.test.ts +++ b/src/test/activation/node/analysisOptions.unit.test.ts @@ -9,7 +9,7 @@ import { NodeLanguageServerAnalysisOptions } from '../../../client/activation/no import { ILanguageServerOutputChannel } from '../../../client/activation/types'; import { IWorkspaceService } from '../../../client/common/application/types'; import { PYTHON, PYTHON_LANGUAGE } from '../../../client/common/constants'; -import { IExperimentService, ILogOutputChannel } from '../../../client/common/types'; +import { ILogOutputChannel } from '../../../client/common/types'; suite('Pylance Language Server - Analysis Options', () => { class TestClass extends NodeLanguageServerAnalysisOptions { From 759fe74c75e584ae831d2a4f182aa131ad53e2c4 Mon Sep 17 00:00:00 2001 From: eleanorjboyd Date: Tue, 16 May 2023 08:55:43 -0700 Subject: [PATCH 17/17] reformat --- pythonFiles/vscode_pytest/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonFiles/vscode_pytest/__init__.py b/pythonFiles/vscode_pytest/__init__.py index f3e7088c0135..0f0bcbd1d323 100644 --- a/pythonFiles/vscode_pytest/__init__.py +++ b/pythonFiles/vscode_pytest/__init__.py @@ -482,4 +482,4 @@ def post_response(cwd: str, session_node: TestNode) -> None: s.socket.sendall(request.encode("utf-8")) except Exception as e: print(f"Plugin error connection error[vscode-pytest]: {e}") - print(f"[vscode-pytest] data: {request}") \ No newline at end of file + print(f"[vscode-pytest] data: {request}")