From 373fad9dc55c3d8eb7d50d2b2f89664fec61bfae Mon Sep 17 00:00:00 2001 From: git-harry Date: Tue, 2 Sep 2014 13:04:06 +0100 Subject: [PATCH] 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 --- run_tests.sh | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.45.2