summaryrefslogtreecommitdiff
path: root/igor.py
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 /igor.py
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.
Diffstat (limited to 'igor.py')
-rw-r--r--igor.py13
1 files changed, 8 insertions, 5 deletions
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))