diff --git a/tests/test_creation.py b/tests/test_creation.py index 879c31dc6..32b859fae 100644 --- a/tests/test_creation.py +++ b/tests/test_creation.py @@ -34,7 +34,7 @@ def test_baking_configs(config): verify_folders(project_directory, config) verify_files(project_directory, config) verify_makefile_commands(project_directory, config) - + def verify_folders(root, config): ''' Tests that expected folders and only expected folders exist. @@ -146,11 +146,11 @@ def verify_makefile_commands(root, config): else: raise ValueError(f"Environment manager '{config['environment_manager']}' not found in test harnesses.") - result = run(["bash", str(harness_path), str(root.resolve())], stderr=PIPE, stdout=PIPE) + result = run(["bash", str(harness_path), str(root.resolve())], stderr=PIPE, stdout=PIPE, encoding="utf-8") # normally hidden by pytest except in failure we want this displayed print("\n======================= STDOUT ======================") - print(result.stdout.decode()) + print(result.stdout.decode(encoding="utf-8")) print("\n======================= STDERR ======================") - print(result.stderr.decode()) + print(result.stderr.decode(encoding="utf-8")) assert result.returncode == 0 diff --git a/tests/virtualenv_harness.sh b/tests/virtualenv_harness.sh index e10a78798..687e1c26e 100644 --- a/tests/virtualenv_harness.sh +++ b/tests/virtualenv_harness.sh @@ -29,8 +29,17 @@ export WORKON_HOME=$TEMP_ENV_ROOT if [[ $(which virtualenvwrapper.sh) ]]; then VIRTUALENVWRAPPER_SCRIPT=$(which virtualenvwrapper.sh) else - VIRTUALENVWRAPPER_SCRIPT=$(find ${PATH//:/ } -name "virtualenvwrapper.sh" -maxdepth 1) + for path in ${PATH//:/ }; do + if [ -d "$path" ]; then + echo "Searching $path for virtualenvwrapper.sh" + FIND_RESULT=$(find $path -maxdepth 1 -name "virtualenvwrapper.sh") + if [[ "$FIND_RESULT" ]]; then + VIRTUALENVWRAPPER_SCRIPT=$FIND_RESULT + fi + fi + done fi +echo VIRTUALENVWRAPPER_SCRIPT=$VIRTUALENVWRAPPER_SCRIPT source $VIRTUALENVWRAPPER_SCRIPT make create_environment