提交 c598e4cd 编写于 作者: C Cleber Rosa

selftests: use the proper Python version when listing tests

In the parallel execution, not honoring the Python version used
elsewhere may cause unexpected issues.  One is an error situation in
which Python 3's unittest.loader can not load an exception definition
that exists only Python 2.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 4e7f3df5
......@@ -29,10 +29,10 @@ parallel_selftests() {
# The directories that may contain files with tests, from the Avocado core
# and from all optional plugins
declare -A TESTS
TESTS[selftests]=$(${FIND_UNITTESTS} | sort -R)
TESTS[selftests]=$(${PYTHON} ${FIND_UNITTESTS} | sort -R)
for PLUGIN in $(find optional_plugins -mindepth 1 -maxdepth 1 -type d); do
PLUGIN_BASENAME=$(basename $PLUGIN)
THIS_DIR_TESTS=$(${FIND_UNITTESTS} --no-base-selftests --plugin-dirs $PLUGIN_BASENAME | sort -R)
THIS_DIR_TESTS=$(${PYTHON} ${FIND_UNITTESTS} --no-base-selftests --plugin-dirs $PLUGIN_BASENAME | sort -R)
if [ -n "$THIS_DIR_TESTS" ]; then
TESTS[$PLUGIN]=${THIS_DIR_TESTS};
fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册