Skip to content

Revisit environment variable collection in terminalEnvVarCollectionService test #24738

@anthonykim1

Description

@anthonykim1

API mentions

		/**
		 * Gets the extension's global environment variable collection for this workspace, enabling changes to be
		 * applied to terminal environment variables.
		 */
		readonly environmentVariableCollection: GlobalEnvironmentVariableCollection;

so

        when(context.environmentVariableCollection).thenReturn(instance(globalCollection));
        when(globalCollection.getScoped(anything())).thenReturn(instance(collection));

in src/test/interpreters/activation/terminalEnvVarCollectionService.unit.test.ts IS actually correct.

Should delete question

 // Question: Why do we have to set up environmentVariableCollection and globalEnvironmentVariableCollection in this flip-flop way?
        // Reference: /vscode-python/src/test/interpreters/activation/terminalEnvVarCollectionService.unit.test.ts

metnioned in src/test/terminals/shellIntegration/pythonStartup.test.ts

Metadata

Metadata

Assignees

Labels

area-environmentsFeatures relating to handling interpreter environmentsdebtCovers everything internal: CI, testing, refactoring of the codebase, etc.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions