@@ -3,6 +3,7 @@ import assert from 'assert';
33import * as sinon from 'sinon' ;
44import { Uri } from 'vscode' ;
55import { PythonEnvironment , PythonEnvironmentApi } from '../../../api' ;
6+ import { isWindows } from '../../../common/utils/platformUtils' ;
67import { PythonEnvironmentImpl } from '../../../internal.api' ;
78import { CondaEnvManager } from '../../../managers/conda/condaEnvManager' ;
89import { 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