diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-08-25 14:57:39 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-08-25 14:57:39 -0400 |
commit | a7acd74eabe3a0764c50bba7eb1f1dd5acef46c7 (patch) | |
tree | 144f0f229679f522f665d41debaf2323b5ad4d86 /igor.py | |
parent | c813804af6c916d8cfdd175ad031b4042b13bfab (diff) | |
download | python-coveragepy-git-a7acd74eabe3a0764c50bba7eb1f1dd5acef46c7.tar.gz |
Better metacov file naming and combining
Now .metacov data files are named for the platform they are running on,
and are combined at the end of the test suite, so each platform only
has a dozen files to copy, instead of hundreds.
Diffstat (limited to 'igor.py')
-rw-r--r-- | igor.py | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -15,7 +15,6 @@ import glob import inspect import os import platform -import socket import sys import textwrap import warnings @@ -120,10 +119,14 @@ def run_tests_with_coverage(tracer, *nose_args): # Make names for the data files that keep all the test runs distinct. impl = platform.python_implementation().lower() version = "%s%s" % sys.version_info[:2] - suffix = "%s%s_%s_%s" % (impl, version, tracer, socket.gethostname()) + if '__pypy__' in sys.builtin_module_names: + version += "_%s%s" % sys.pypy_version_info[:2] + suffix = "%s%s_%s_%s" % (impl, version, tracer, platform.platform()) + + os.environ['COVERAGE_METAFILE'] = os.path.abspath(".metacov."+suffix) import coverage - cov = coverage.Coverage(config_file="metacov.ini", data_suffix=suffix) + cov = coverage.Coverage(config_file="metacov.ini", data_suffix=False) # Cheap trick: the coverage.py code itself is excluded from measurement, # but if we clobber the cover_prefix in the coverage object, we can defeat # the self-detection. @@ -157,6 +160,7 @@ def run_tests_with_coverage(tracer, *nose_args): cov.stop() os.remove(pth_path) + #cov.combine() cov.save() @@ -310,8 +314,7 @@ def print_banner(label): version = platform.python_version() if '__pypy__' in sys.builtin_module_names: - pypy_version = sys.pypy_version_info - version += " (pypy %s)" % ".".join(str(v) for v in pypy_version) + version += " (pypy %s)" % ".".join(str(v) for v in sys.pypy_version_info) which_python = os.path.relpath(sys.executable) print('=== %s %s %s (%s) ===' % (impl, version, label, which_python)) |