File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -553,8 +553,15 @@ function run_tests()
553
553
fi
554
554
done
555
555
556
+ # ./src/tests is being moved to ./tests, this small patch supports both paths
557
+ if [[ -e " /ynh-dev/yunohost/tests/conftest.py" ]]; then
558
+ tests_parentdir=/ynh-dev/yunohost
559
+ else
560
+ tests_parentdir=/ynh-dev/yunohost/src
561
+ fi
562
+
556
563
# Apps for test
557
- cd /ynh-dev/yunohost/src/ tests
564
+ cd " $tests_parentdir / tests"
558
565
[ -d " apps" ] || git clone https://github.com/YunoHost/test_apps ./apps
559
566
cd apps
560
567
git pull > /dev/null 2>&1
@@ -563,20 +570,14 @@ function run_tests()
563
570
info " Running tests for YunoHost"
564
571
[ -e " /etc/yunohost/installed" ] || critical " You should run postinstallation before running tests :s."
565
572
566
- # ./src/tests is being moved to ./tests, this small patch supports both paths
567
- if [[ -e " /ynh-dev/yunohost/src/tests" ]]; then
568
- cd /ynh-dev/yunohost/src
569
- else
570
- cd /ynh-dev/yunohost
571
- fi
572
-
573
573
testpath=tests
574
574
if [[ -n " $TEST_MODULE " ]]; then
575
575
testpath=" ${testpath} /test_${TEST_MODULE} .py"
576
576
if [[ -n " $TEST_FUNCTION " ]]; then
577
577
testpath=" ${testpath} ::test_${TEST_FUNCTION} "
578
578
fi
579
579
fi
580
+ cd " $tests_parentdir "
580
581
pytest " $testpath "
581
582
;;
582
583
esac
You can’t perform that action at this time.
0 commit comments