@@ -45,7 +45,7 @@ suite('Copy Path To Clipboard', () => {
4545 await copyPathToClipboard ( item ) ;
4646
4747 sinon . assert . calledOnce ( clipboardWriteTextStub ) ;
48- sinon . assert . calledWith ( clipboardWriteTextStub , '/test-env/bin/test -m env ' ) ;
48+ sinon . assert . calledWith ( clipboardWriteTextStub , '/test-env/bin/test' ) ;
4949 } ) ;
5050
5151 test ( 'Copy env path to clipboard: env manager view' , async ( ) => {
@@ -63,6 +63,56 @@ suite('Copy Path To Clipboard', () => {
6363 await copyPathToClipboard ( item ) ;
6464
6565 sinon . assert . calledOnce ( clipboardWriteTextStub ) ;
66- sinon . assert . calledWith ( clipboardWriteTextStub , '/test-env/bin/test -m env' ) ;
66+ sinon . assert . calledWith ( clipboardWriteTextStub , '/test-env/bin/test' ) ;
67+ } ) ;
68+
69+ test ( 'Copy conda env path to clipboard: should copy interpreter path not conda run command' , async ( ) => {
70+ const item = new PythonEnvTreeItem (
71+ {
72+ envId : { managerId : 'conda' , id : 'base' } ,
73+ name : 'base' ,
74+ displayName : 'base (3.12.2)' ,
75+ displayPath : '/opt/conda/envs/base' ,
76+ execInfo : {
77+ run : { executable : '/opt/conda/envs/base/bin/python' } ,
78+ activatedRun : {
79+ executable : 'conda' ,
80+ args : [ 'run' , '--name' , 'base' , 'python' ] ,
81+ }
82+ } ,
83+ } as PythonEnvironment ,
84+ new EnvManagerTreeItem ( { name : 'conda' , id : 'conda' } as InternalEnvironmentManager ) ,
85+ ) ;
86+
87+ await copyPathToClipboard ( item ) ;
88+
89+ sinon . assert . calledOnce ( clipboardWriteTextStub ) ;
90+ // Should copy the actual interpreter path, not the conda run command
91+ sinon . assert . calledWith ( clipboardWriteTextStub , '/opt/conda/envs/base/bin/python' ) ;
92+ } ) ;
93+
94+ test ( 'Copy conda prefix env path to clipboard: should copy interpreter path not conda run command' , async ( ) => {
95+ const item = new PythonEnvTreeItem (
96+ {
97+ envId : { managerId : 'conda' , id : 'myenv' } ,
98+ name : 'myenv' ,
99+ displayName : 'myenv (3.11.5)' ,
100+ displayPath : '/opt/conda/envs/myenv' ,
101+ execInfo : {
102+ run : { executable : '/opt/conda/envs/myenv/bin/python' } ,
103+ activatedRun : {
104+ executable : 'conda' ,
105+ args : [ 'run' , '--prefix' , '/opt/conda/envs/myenv' , 'python' ] ,
106+ }
107+ } ,
108+ } as PythonEnvironment ,
109+ new EnvManagerTreeItem ( { name : 'conda' , id : 'conda' } as InternalEnvironmentManager ) ,
110+ ) ;
111+
112+ await copyPathToClipboard ( item ) ;
113+
114+ sinon . assert . calledOnce ( clipboardWriteTextStub ) ;
115+ // Should copy the actual interpreter path, not the conda run command
116+ sinon . assert . calledWith ( clipboardWriteTextStub , '/opt/conda/envs/myenv/bin/python' ) ;
67117 } ) ;
68118} ) ;
0 commit comments