summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-08-25 14:57:39 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-08-25 14:57:39 -0400
commit2a008eaee636cdd03202e9def9005743c4bdad1b (patch)
tree4391b4c6f9b961b550b8154241fdea6d312ae038
parent3419b90f36dfc2ea4305a89f731ceb99a8e1eecc (diff)
downloadpython-coveragepy-2a008eaee636cdd03202e9def9005743c4bdad1b.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.
-rw-r--r--coverage/data.py2
-rw-r--r--igor.py13
-rw-r--r--metacov.ini2
3 files changed, 10 insertions, 7 deletions
diff --git a/coverage/data.py b/coverage/data.py
index c19b5c6..4188339 100644
--- a/coverage/data.py
+++ b/coverage/data.py
@@ -102,7 +102,7 @@ class CoverageData(object):
# * runs: a list of dicts of information about the coverage.py runs
# contributing to the data::
#
- # [ { "briefsys": "CPython 2.7.10 Darwin" }, ... ]
+ # [ { "brief_sys": "CPython 2.7.10 Darwin" }, ... ]
#
# Only one of `lines` or `arcs` will be present: with branch coverage, data
# is stored as arcs. Without branch coverage, it is stored as lines. The
diff --git a/igor.py b/igor.py
index 0cb7c70..54d39d7 100644
--- a/igor.py
+++ b/igor.py
@@ -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))
diff --git a/metacov.ini b/metacov.ini
index ba8c234..fd7c7d0 100644
--- a/metacov.ini
+++ b/metacov.ini
@@ -4,7 +4,7 @@
# Settings to use when using coverage.py to measure itself.
[run]
branch = true
-data_file = $COVERAGE_HOME/.metacov
+data_file = $COVERAGE_METAFILE
parallel = true
source =
$COVERAGE_HOME/coverage