From 325b763d9c0f693728335204b5fd4056a3c21b31 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Fri, 24 Apr 2020 00:35:10 -0700 Subject: [PATCH 1/2] Ensure env gets used when running unittest --- src/client/common/process/internal/scripts/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]; } From d87fdb9e162c823946ff605dc38ffa194bcde6d2 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Fri, 24 Apr 2020 13:56:07 -0700 Subject: [PATCH 2/2] Fix tests --- src/test/testing/common/debugLauncher.unit.test.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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; }