diff --git a/testsuite/expect/test41.2 b/testsuite/expect/test41.2 index 294c6fe3c945fa7817d8589260199d4ab803b848..51b9a1b4189c4d54f5c185af6221c26d671ea3ef 100755 --- a/testsuite/expect/test41.2 +++ b/testsuite/expect/test41.2 @@ -111,16 +111,21 @@ foreach content_path [glob -type d $scripts/*] { run_command -nolog -subtest \ "$bin_oasgen generate -i '$spec' -g python --strict-spec=true -o '$pyapi'" - run_command -nolog -subtest \ - "$bin_py3 '$pyapi/setup.py' install --prefix='$pypath'" + # Python requires PYTHONPATH point to the site-packages dir (not a parent) + set py_include_path [string trim [run_command_output -fail \ + "$bin_py3 -c 'import sys; print(\"lib/python%d.%d/site-packages\" % + (sys.version_info\[0\], sys.version_info\[1\]))'" ] ] # Add the installed path to make sure python will find it if { [info exists ::env(PYTHONPATH)] } { - set env(PYTHONPATH) [join [list $pypath:$pyapi $env(PYTHONPATH)] ":"] + set env(PYTHONPATH) [join [list "$pypath/$py_include_path" $pyapi $env(PYTHONPATH)] ":"] } else { - set env(PYTHONPATH) $pypath:$pyapi + set env(PYTHONPATH) "$pypath/$py_include_path:$pyapi" } + run_command -nolog -subtest \ + "$bin_py3 '$pyapi/setup.py' install --prefix='$pypath'" + foreach script [glob -type f $scripts/$content/*.py] { log_debug "running: $script"