Skip to content

Commit

Permalink
Add more verbose in run-tests scripts about python
Browse files Browse the repository at this point in the history
  • Loading branch information
cderv committed Sep 14, 2023
1 parent 0ecfa9c commit 7430f0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/run-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ If ($null -eq $Env:QUARTO_TESTS_FORCE_NO_PIPENV) {
$OLD_VIRTUAL_ENV=$VIRTUAL_ENV
Write-Host "> Activating virtualenv for Python tests in Quarto"
. "$(pipenv --venv)/Scripts/activate.ps1"
Write-Host "> Using Python from " -NoNewline; Write-Host "$((gcm python).Source)" -ForegroundColor Blue;
Write-Host "> VIRTUAL_ENV: " -NoNewline; Write-Host "$($env:VIRTUAL_ENV)" -ForegroundColor Blue;
$quarto_venv_activated = $true
}

Expand All @@ -159,11 +161,15 @@ $DENO_EXIT_CODE = $LASTEXITCODE
If($quarto_venv_activated) {
Write-Host "> Exiting virtualenv activated for tests"
deactivate
Write-Host "> Using Python from " -NoNewline; Write-Host "$((gcm python).Source)" -ForegroundColor Blue;
Write-Host "> VIRTUAL_ENV: " -NoNewline; Write-Host "$($env:VIRTUAL_ENV)" -ForegroundColor Blue;
Remove-Variable quarto_venv_activated
}
If($null -ne $OLD_VIRTUAL_ENV) {
Write-Host "> Reactivating original virtualenv"
. "$OLD_VIRTUAL_ENV/Scripts/activate.ps1"
Write-Host "> New Python from " -NoNewline; Write-Host "$((gcm python).Source)" -ForegroundColor Blue;
Write-Host "> VIRTUAL_ENV: " -NoNewline; Write-Host "$($env:VIRTUAL_ENV)" -ForegroundColor Blue;
Remove-Variable OLD_VIRTUAL_ENV
}

Expand Down
6 changes: 6 additions & 0 deletions tests/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ then
OLD_VIRTUAL_ENV=$VIRTUAL_ENV
echo "> Activating virtualenv for Python tests in Quarto"
source "$(pipenv --venv)/bin/activate"
echo "> Using Python from $(which python)"
echo "> VIRTUAL_ENV: ${VIRTUAL_ENV}"
quarto_venv_activated="true"
fi

Expand Down Expand Up @@ -118,12 +120,16 @@ if [[ $quarto_venv_activated == "true" ]]
then
echo "> Exiting virtualenv activated for tests"
deactivate
echo "> Using Python from $(which python)"
echo "> VIRTUAL_ENV: ${VIRTUAL_ENV}"
unset quarto_venv_activated
fi
if [[ -n $OLD_VIRTUAL_ENV ]]
then
echo "> Reactivating original virtualenv"
source $OLD_VIRTUAL_ENV/bin/activate
echo "> Using Python from $(which python)"
echo "> VIRTUAL_ENV: ${VIRTUAL_ENV}"
unset OLD_VIRTUAL_ENV
fi

Expand Down

0 comments on commit 7430f0e

Please sign in to comment.