Skip to content

Commit 5c50426

Browse files
authored
disable extra output for no config debug (#565)
1 parent febecdd commit 5c50426

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/extension/noConfigDebugInit.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ export async function registerNoConfigDebug(
4646
}
4747
const tempFilePath = path.join(tempDirPath, 'debuggerAdapterEndpoint.txt');
4848

49+
// Add env var for PYDEVD_DISABLE_FILE_VALIDATION to disable extra output in terminal when starting the debug session.
50+
collection.replace('PYDEVD_DISABLE_FILE_VALIDATION', '1');
51+
4952
// Add env vars for DEBUGPY_ADAPTER_ENDPOINTS, BUNDLED_DEBUGPY_PATH, and PATH
5053
collection.replace('DEBUGPY_ADAPTER_ENDPOINTS', tempFilePath);
5154

src/test/unittest/noConfigDebugInit.unit.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ suite('setup for no-config debug scenario', function () {
6262
assert(value.includes('noConfigDebugAdapterEndpoints-1234567899'));
6363
} else if (key === BUNDLED_DEBUGPY_PATH) {
6464
assert(value === bundledDebugPath);
65+
} else if (key === 'PYDEVD_DISABLE_FILE_VALIDATION') {
66+
assert(value === '1');
6567
}
6668
})
6769
.returns(envVarCollectionReplaceStub);
@@ -82,7 +84,7 @@ suite('setup for no-config debug scenario', function () {
8284
await registerNoConfigDebug(context.object.environmentVariableCollection, context.object.extensionPath);
8385

8486
// assert that functions called right number of times
85-
sinon.assert.calledTwice(envVarCollectionReplaceStub);
87+
sinon.assert.calledThrice(envVarCollectionReplaceStub);
8688
sinon.assert.calledOnce(envVarCollectionAppendStub);
8789
});
8890

0 commit comments

Comments
 (0)