Skip to content

Commit ad14f57

Browse files
committed
fix test failure
1 parent 35a0aa1 commit ad14f57

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/test/managers/conda/condaEnvManager.findEnvironmentByPath.unit.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import assert from 'assert';
33
import * as sinon from 'sinon';
44
import { Uri } from 'vscode';
55
import { PythonEnvironment, PythonEnvironmentApi } from '../../../api';
6+
import { isWindows } from '../../../common/utils/platformUtils';
67
import { PythonEnvironmentImpl } from '../../../internal.api';
78
import { CondaEnvManager } from '../../../managers/conda/condaEnvManager';
89
import { NativePythonFinder } from '../.././../managers/common/nativePythonFinder';
@@ -177,8 +178,10 @@ suite('CondaEnvManager - findEnvironmentByPath', () => {
177178
});
178179

179180
// --- Windows-style paths ---
181+
// Uri.file() lowercases drive letters on non-Windows, causing path mismatches
182+
// with normalizePath which only lowercases on Windows. Skip on Linux/macOS.
180183

181-
test('Works with Windows-style backslash paths', () => {
184+
(isWindows() ? test : test.skip)('Works with Windows-style backslash paths', () => {
182185
const base = makeEnv('base', 'C:\\Users\\user\\miniconda3', '3.12.0');
183186
const named = makeEnv('torch', 'C:\\Users\\user\\miniconda3\\envs\\torch', '3.13.0');
184187

@@ -188,7 +191,7 @@ suite('CondaEnvManager - findEnvironmentByPath', () => {
188191
assert.strictEqual(result, base, 'Should return base on Windows paths');
189192
});
190193

191-
test('Windows: exact match on named env path', () => {
194+
(isWindows() ? test : test.skip)('Windows: exact match on named env path', () => {
192195
const base = makeEnv('base', 'C:\\Users\\user\\miniconda3', '3.12.0');
193196
const named = makeEnv('myenv', 'C:\\Users\\user\\miniconda3\\envs\\myenv', '3.11.0');
194197

0 commit comments

Comments
 (0)