File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -562,21 +562,22 @@ function run_tests()
562562 # Run tests
563563 info " Running tests for YunoHost"
564564 [ -e " /etc/yunohost/installed" ] || critical " You should run postinstallation before running tests :s."
565- if [[ -z " $TEST_MODULE " ]]
566- then
567- cd /ynh-dev/yunohost/
568- py.test tests
565+
566+ # ./src/tests is being moved to ./tests, this small patch supports both paths
567+ if [[ -e " /ynh-dev/yunohost/src/tests" ]]; then
569568 cd /ynh-dev/yunohost/src
570- py.test tests
571569 else
572- cd /ynh-dev/yunohost/src
573- if [[ -z " $TEST_FUNCTION " ]]
574- then
575- py.test tests/test_" $TEST_MODULE " .py
576- else
577- py.test tests/test_" $TEST_MODULE " .py::test_" $TEST_FUNCTION "
570+ cd /ynh-dev/yunohost
571+ fi
572+
573+ testpath=tests
574+ if [[ -n " $TEST_MODULE " ]]; then
575+ testpath=" ${testpath} /test_${TEST_MODULE} .py"
576+ if [[ -n " $TEST_FUNCTION " ]]; then
577+ testpath=" ${testpath} ::test_${TEST_FUNCTION} "
578578 fi
579579 fi
580+ pytest " $testpath "
580581 ;;
581582 esac
582583 done
You can’t perform that action at this time.
0 commit comments