Skip to content

Commit 2a09546

Browse files
authored
Remove isolate script when running unittest (#11378) (#11407)
* Ensure env gets used when running unittest * Fix tests
1 parent 7d0ed6c commit 2a09546

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/client/common/process/internal/scripts/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,5 +331,5 @@ export function testlauncher(testArgs: string[]): string[] {
331331
export function visualstudio_py_testlauncher(testArgs: string[]): string[] {
332332
const script = path.join(SCRIPTS_DIR, 'visualstudio_py_testlauncher.py');
333333
// There is no output to parse, so we do not return a function.
334-
return [ISOLATED, script, ...testArgs];
334+
return [script, ...testArgs];
335335
}

src/test/testing/common/debugLauncher.unit.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,14 @@ suite('Unit Tests - Debug Launcher', () => {
207207
expected = getDefaultDebugConfig();
208208
}
209209
expected.rules = [{ path: path.join(EXTENSION_ROOT_DIR, 'pythonFiles'), include: false }];
210-
expected.program = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'pyvsc-run-isolated.py');
211-
expected.args = [testLaunchScript, ...options.args];
210+
if (testProvider === 'unittest') {
211+
expected.program = testLaunchScript;
212+
expected.args = options.args;
213+
} else {
214+
expected.program = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'pyvsc-run-isolated.py');
215+
expected.args = [testLaunchScript, ...options.args];
216+
}
217+
212218
if (!expected.cwd) {
213219
expected.cwd = workspaceFolders[0].uri.fsPath;
214220
}

0 commit comments

Comments
 (0)