Skip to content

Commit c5b7d9f

Browse files
authored
For test runs in pwsh, use discovered path to python more often (#426)
1 parent 4074837 commit c5b7d9f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

behave.ps1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ function Command-Available {
2626
}
2727

2828
function Env-Exists {
29-
pipenv --venv 2>&1 | Out-Null
29+
param($PythonCmd)
30+
& $PythonCmd -m pipenv --venv 2>&1 | Out-Null
3031
return $?
3132
}
3233

@@ -43,17 +44,17 @@ try {
4344

4445
if (Test-Path $ReInitFlag) {
4546
Write-Host "Reinitializing"
46-
pipenv --rm
47+
& $PythonCmd -m pipenv --rm
4748
Remove-Item $ReInitFlag
4849
}
4950

50-
if (-not (Env-Exists)) {
51+
if (-not (Env-Exists $PythonCmd)) {
5152
Write-Host "Creating pipenv with $PythonCmd"
52-
pipenv --python $PythonCmd
53-
pipenv sync
53+
& $PythonCmd -m pipenv --python $PythonCmd
54+
& $PythonCmd -m pipenv sync
5455
}
5556

56-
pipenv run behave @Args
57+
& $PythonCmd -m pipenv run behave @Args
5758
}
5859
finally {
5960
Pop-Location

0 commit comments

Comments
 (0)