@@ -72,16 +72,16 @@ public void testPythonEnvManager() {
7272 envManager .setPythonEnvTool (PythonEnvManager .ENV_TOOL_CONDA );
7373 envManager .setCondaPythonVersion ("3.9" );
7474 String condaEnvCommand39 = envManager .getBuildEnvCommand (requirementPath );
75- Assert .assertEquals (condaEnvCommand39 , "conda create -y python=3.9 -p ./venv && source activate ./venv && python -m pip install -r " + requirementPath );
75+ Assert .assertEquals (condaEnvCommand39 , "conda create -y python=3.9 -p ./venv && source activate ./venv && ./venv/bin/ python -m pip install -r " + requirementPath );
7676
7777 envManager .setCondaPythonVersion ("3.8" );
7878 String condaEnvCommand38 = envManager .getBuildEnvCommand (requirementPath );
79- Assert .assertEquals (condaEnvCommand38 , "conda create -y python=3.8 -p ./venv && source activate ./venv && python -m pip install -r " + requirementPath );
79+ Assert .assertEquals (condaEnvCommand38 , "conda create -y python=3.8 -p ./venv && source activate ./venv && ./venv/bin/ python -m pip install -r " + requirementPath );
8080
8181
8282 envManager .setPythonEnvTool (PythonEnvManager .ENV_TOOL_VENV );
8383 String venvEnvCommand = envManager .getBuildEnvCommand (requirementPath );
84- Assert .assertEquals (venvEnvCommand , "virtualenv -p ${PYTHON_HOME} ./venv && source ./venv/bin/activate && python -m pip install -r " + requirementPath );
84+ Assert .assertEquals (venvEnvCommand , "virtualenv -p ${PYTHON_HOME} ./venv && source ./venv/bin/activate && ./venv/bin/ python -m pip install -r " + requirementPath );
8585
8686 }
8787
@@ -146,7 +146,7 @@ public void testBuildPythonCommandWithCreateCondeEnv() throws Exception {
146146 PytorchTask task = initTask (parameters );
147147 Assert .assertEquals (task .buildPythonExecuteCommand (),
148148 "export PYTHONPATH=.\n " +
149- "conda create -y python=3.6 -p ./venv && source activate ./venv && python -m pip install -r requirements.txt\n " +
149+ "conda create -y python=3.6 -p ./venv && source activate ./venv && ./venv/bin/ python -m pip install -r requirements.txt\n " +
150150 "./venv/bin/python main.py --epochs=1 --dry-run" );
151151 }
152152
@@ -163,7 +163,7 @@ public void testBuildPythonCommandWithCreateVenvEnv() throws Exception {
163163 PytorchTask task = initTask (parameters );
164164 Assert .assertEquals (task .buildPythonExecuteCommand (),
165165 "export PYTHONPATH=.\n " +
166- "virtualenv -p ${PYTHON_HOME} ./venv && source ./venv/bin/activate && python -m pip install -r requirements.txt\n " +
166+ "virtualenv -p ${PYTHON_HOME} ./venv && source ./venv/bin/activate && ./venv/bin/ python -m pip install -r requirements.txt\n " +
167167 "./venv/bin/python main.py --epochs=1 --dry-run" );
168168
169169 }
@@ -189,7 +189,7 @@ public void testGetPossiblePath() throws Exception {
189189 createFile (scriptFile );
190190
191191 String expected = "export PYTHONPATH=%s\n " +
192- "virtualenv -p ${PYTHON_HOME} ./venv && source ./venv/bin/activate && python -m pip install -r %s\n " +
192+ "virtualenv -p ${PYTHON_HOME} ./venv && source ./venv/bin/activate && ./venv/bin/ python -m pip install -r %s\n " +
193193 "./venv/bin/python %s" ;
194194 System .out .println (task .buildPythonExecuteCommand ());
195195 Assert .assertEquals (String .format (expected , pythonPath , requirementFile , scriptFile ), task .buildPythonExecuteCommand ());
0 commit comments