summaryrefslogtreecommitdiff
path: root/functional_tests
diff options
context:
space:
mode:
authorGary Donovan <garyd@crucialfruit.com.au>2011-07-14 17:32:16 +1000
committerGary Donovan <garyd@crucialfruit.com.au>2011-07-14 17:32:16 +1000
commit7135e1a513f65902c0b10dc77e55a1f1a4ebf0d4 (patch)
treebc97fb90f0ad5b32854f2abb03b8c92475b02f1e /functional_tests
parent0a1534b6e7269f865558a9b7f3bd1099de3c6d3d (diff)
downloadnose-7135e1a513f65902c0b10dc77e55a1f1a4ebf0d4.tar.gz
Fix test failure with Python 3.
We should cleanup the coverage output after running coverage tests, otherwise they end up in the Python 3 test data and cause a unpickle error. See Google Code Issue 435 for more details.
Diffstat (limited to 'functional_tests')
-rw-r--r--functional_tests/doc_tests/test_coverage_html/coverage_html_fixtures.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/functional_tests/doc_tests/test_coverage_html/coverage_html_fixtures.py b/functional_tests/doc_tests/test_coverage_html/coverage_html_fixtures.py
index 2ee5666..6829dc2 100644
--- a/functional_tests/doc_tests/test_coverage_html/coverage_html_fixtures.py
+++ b/functional_tests/doc_tests/test_coverage_html/coverage_html_fixtures.py
@@ -1,10 +1,13 @@
import sys
import os
+import shutil
from nose.plugins.skip import SkipTest
from nose.plugins.cover import Coverage
from nose.plugins.plugintest import munge_nose_output_for_doctest
-_multiprocess_can_split_ = True
+# This fixture is not reentrant because we have to cleanup the files that
+# coverage produces once all tests have finished running.
+_multiprocess_shared_ = True
def setup_module():
try:
@@ -14,3 +17,10 @@ def setup_module():
"plugin itself.")
except ImportError:
raise SkipTest("coverage module not available")
+
+def teardown_module():
+ # Clean up the files produced by coverage
+ cover_html_dir = os.path.join(os.path.dirname(__file__), 'support', 'cover')
+ if os.path.exists(cover_html_dir):
+ shutil.rmtree(cover_html_dir)
+