From 0c0b02c94a7dfa6ad8449c25a5a703519c38e504 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Fri, 24 Apr 2020 16:58:27 -0700 Subject: [PATCH] Remove isolate script when running unittest (#11378) * Ensure env gets used when running unittest * Fix tests --- src/client/common/process/internal/scripts/index.ts | 2 +- src/test/testing/common/debugLauncher.unit.test.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/client/common/process/internal/scripts/index.ts b/src/client/common/process/internal/scripts/index.ts index cadd721f837a..f035302c685c 100644 --- a/src/client/common/process/internal/scripts/index.ts +++ b/src/client/common/process/internal/scripts/index.ts @@ -331,5 +331,5 @@ export function testlauncher(testArgs: string[]): string[] { export function visualstudio_py_testlauncher(testArgs: string[]): string[] { const script = path.join(SCRIPTS_DIR, 'visualstudio_py_testlauncher.py'); // There is no output to parse, so we do not return a function. - return [ISOLATED, script, ...testArgs]; + return [script, ...testArgs]; } diff --git a/src/test/testing/common/debugLauncher.unit.test.ts b/src/test/testing/common/debugLauncher.unit.test.ts index 2efc75425550..13cea2c94e0f 100644 --- a/src/test/testing/common/debugLauncher.unit.test.ts +++ b/src/test/testing/common/debugLauncher.unit.test.ts @@ -207,8 +207,14 @@ suite('Unit Tests - Debug Launcher', () => { expected = getDefaultDebugConfig(); } expected.rules = [{ path: path.join(EXTENSION_ROOT_DIR, 'pythonFiles'), include: false }]; - expected.program = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'pyvsc-run-isolated.py'); - expected.args = [testLaunchScript, ...options.args]; + if (testProvider === 'unittest') { + expected.program = testLaunchScript; + expected.args = options.args; + } else { + expected.program = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'pyvsc-run-isolated.py'); + expected.args = [testLaunchScript, ...options.args]; + } + if (!expected.cwd) { expected.cwd = workspaceFolders[0].uri.fsPath; }