Skip to content

Commit fffa444

Browse files
authored
Remove explicit initialization of PYTHONPATH with workspace for dbg test (microsoft#1576)
* Remove explicit initialization of PYTHONPATH with workspace for dbg test * code review fixes * fix code review comments * Fixes microsoft#1465
1 parent 4bb0644 commit fffa444

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

news/3 Code Health/1465.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove explicit initialization of PYTHONPATH with the current workspace path in unit testing of modules with the experimental debugger.

src/test/debugger/module.test.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ suite(`Module Debugging - Misc tests: ${debuggerType}`, () => {
3535
} catch (ex) { }
3636
await sleep(1000);
3737
});
38-
function buildLauncArgs(): LaunchRequestArguments {
39-
const env = {};
40-
// tslint:disable-next-line:no-string-literal
41-
env['PYTHONPATH'] = `.${path.delimiter}${PTVSD_PATH}`;
42-
38+
function buildLaunchArgs(): LaunchRequestArguments {
4339
// tslint:disable-next-line:no-unnecessary-local-variable
4440
const options: LaunchRequestArguments = {
4541
module: 'mymod',
@@ -48,7 +44,7 @@ suite(`Module Debugging - Misc tests: ${debuggerType}`, () => {
4844
debugOptions: [DebugOptions.RedirectOutput],
4945
pythonPath: PYTHON_PATH,
5046
args: [],
51-
env,
47+
env: { PYTHONPATH: `${PTVSD_PATH}` },
5248
envFile: '',
5349
logToFile: false,
5450
type: debuggerType
@@ -60,7 +56,7 @@ suite(`Module Debugging - Misc tests: ${debuggerType}`, () => {
6056
test('Test stdout output', async () => {
6157
await Promise.all([
6258
debugClient.configurationSequence(),
63-
debugClient.launch(buildLauncArgs()),
59+
debugClient.launch(buildLaunchArgs()),
6460
debugClient.waitForEvent('initialized'),
6561
debugClient.assertOutput('stdout', 'Hello world!'),
6662
debugClient.waitForEvent('exited'),

0 commit comments

Comments
 (0)