Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update PyREPL shell integration tests
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d598cbab-c8ac-496d-9757-ac98a8c9846f
  • Loading branch information
edvilme committed Aug 24, 2026
commit d511360f8c178d249bdd999472a46ab637452dbe
2 changes: 1 addition & 1 deletion src/client/common/utils/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export namespace Interpreters {
'{0} environment was successfully activated, even though {1} indicator may not be present in the terminal prompt. [Learn more](https://aka.ms/vscodePythonTerminalActivation).',
);
export const shellIntegrationEnvVarCollectionDescription = l10n.t(
'Enables `python.terminal.shellIntegration.enabled` by modifying `PYTHONSTARTUP` and `PYTHON_BASIC_REPL`',
'Enables `python.terminal.shellIntegration.enabled` by modifying `PYTHONSTARTUP`',
);
export const shellIntegrationDisabledEnvVarCollectionDescription = l10n.t(
'Disables `python.terminal.shellIntegration.enabled` by unsetting `PYTHONSTARTUP` and `PYTHON_BASIC_REPL`',
Expand Down
17 changes: 15 additions & 2 deletions src/test/terminals/shellIntegration/pythonStartup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,24 @@ suite('Terminal - Shell Integration with PYTHONSTARTUP', () => {
globalEnvironmentVariableCollection.verify((c) => c.delete('PYTHONSTARTUP'), TypeMoq.Times.once());
});

test('PYTHON_BASIC_REPL is set when shell integration is enabled', async () => {
test('PYTHON_BASIC_REPL is not set when shell integration is enabled', async () => {
pythonConfig.setup((p) => p.get('terminal.shellIntegration.enabled')).returns(() => true);

await registerPythonStartup(context.object);

globalEnvironmentVariableCollection.verify(
(c) => c.replace('PYTHON_BASIC_REPL', TypeMoq.It.isAny(), TypeMoq.It.isAny()),
TypeMoq.Times.never(),
);
});

test('PYTHON_BASIC_REPL is deleted when shell integration is disabled', async () => {
pythonConfig.setup((p) => p.get('terminal.shellIntegration.enabled')).returns(() => false);

await registerPythonStartup(context.object);

globalEnvironmentVariableCollection.verify(
(c) => c.replace('PYTHON_BASIC_REPL', '1', TypeMoq.It.isAny()),
(c) => c.delete('PYTHON_BASIC_REPL'),
TypeMoq.Times.once(),
);
});
Expand Down
Loading