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
This commit is contained in:
git-harry 2014-09-02 13:04:06 +01:00
parent c4bddaa50d
commit 373fad9dc5
1 changed files with 5 additions and 0 deletions

View File

@ -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