Skip to content

Commit c1d66ea

Browse files
committed
fix
1 parent 98f890b commit c1d66ea

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

src/test/integration/pythonProjects.integration.test.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,26 @@ suite('Integration: Python Projects', function () {
194194
return;
195195
}
196196

197+
const project = projects[0];
198+
199+
// Get current environment to ensure we make an actual change
200+
const currentEnv = await api.getEnvironment(project.uri);
201+
202+
// Pick an environment different from current, or clear and re-set
203+
let targetEnv = environments[0];
204+
if (currentEnv && currentEnv.envId.id === targetEnv.envId.id && environments.length > 1) {
205+
targetEnv = environments[1];
206+
}
207+
208+
// Clear environment first to ensure change event fires
209+
// (in case targetEnv is already set)
210+
await api.setEnvironment(project.uri, undefined);
211+
197212
const handler = new TestEventHandler(api.onDidChangeEnvironment, 'onDidChangeEnvironment');
198213

199214
try {
200-
const project = projects[0];
201-
const env = environments[0];
202-
203-
// Set environment
204-
await api.setEnvironment(project.uri, env);
215+
// Set environment - this should fire the event
216+
await api.setEnvironment(project.uri, targetEnv);
205217

206218
// Event should fire
207219
await handler.assertFired(5000);

0 commit comments

Comments
 (0)