From: git-harry Date: Tue, 2 Sep 2014 12:04:06 +0000 (+0100) Subject: Fix running unit tests with coverage X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=373fad9dc55c3d8eb7d50d2b2f89664fec61bfae;p=openstack-build%2Fcinder-build.git Fix running unit tests with coverage The path to this repo is added to PYTHONPATH when the coverage flag is specified so that the cinder entry points are discovered. Change-Id: Ie33a63c6ecd443b900fa7bed3a1ec5b6bb0065e6 Closes-Bug: #1364347 --- diff --git a/run_tests.sh b/run_tests.sh index bc88a8aaa..bf4350849 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -132,6 +132,11 @@ function run_tests { if [ $coverage -eq 1 ]; then TESTRTESTS="$TESTRTESTS --coverage" + if [ -z "${PYTHONPATH:-}" ]; then + export PYTHONPATH=./ + else + export PYTHONPATH=$PYTHONPATH:./ + fi else TESTRTESTS="$TESTRTESTS" fi