Use a fake coverage module instead of real one.

Actually loading the coverage module was leading to odd concurrency
conditions where it was interfering with mocked calls. This changes
to stub out the coverage class with a fake one so that we don't have
to worry about collisions. It also modifies the coverage class to be
created lazily so it isn't automatically started at import time.
Finally it removes the hack in run_tests.sh ignoring the coverage
tests.

Fixes bug 1131023

Change-Id: I39de434454f8b0903f6311e731e215a93027bc91
This commit is contained in:
Vishvananda Ishaya
2013-02-20 19:05:44 -08:00
parent 5ebb3e78f0
commit 39b39b0e00

View File

@@ -110,10 +110,6 @@ function run_tests {
${wrapper} find . -type f -name "*.pyc" -delete ${wrapper} find . -type f -name "*.pyc" -delete
if [ $coverage -eq 1 ]; then if [ $coverage -eq 1 ]; then
# Do not test test_coverage_ext when gathering coverage.
if [ "x$testrargs" = "x" ]; then
testrargs="^(?!.*test.*coverage).*$"
fi
TESTRTESTS="$TESTRTESTS --coverage" TESTRTESTS="$TESTRTESTS --coverage"
else else
TESTRTESTS="$TESTRTESTS --slowest" TESTRTESTS="$TESTRTESTS --slowest"