Commits

Gary Donovan  committed 4906064

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.

  • Participants
  • Parent commits cc95f69
  • Branches issue-435-old-codebase

Comments (0)

Files changed (2)

 .coverage
 nosetests.xml
 xunit.xml
-support/cover/*
 _env
 doc/.build
 dist

File functional_tests/doc_tests/test_coverage_html/coverage_html_fixtures.py

 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:
                            "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)
+