From ea3b37c5b62d835ab301d7f35da72d3e4b2f3292 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 24 Sep 2014 21:03:16 -0400 Subject: "concurrency" is a better name that "coroutine" --- coverage/control.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index 86a2ae2..510ced7 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -45,7 +45,7 @@ class Coverage(object): def __init__(self, data_file=None, data_suffix=None, cover_pylib=None, auto_data=False, timid=None, branch=None, config_file=True, source=None, omit=None, include=None, debug=None, - debug_file=None, coroutine=None, plugins=None): + debug_file=None, concurrency=None, plugins=None): """ `data_file` is the base name of the data file to use, defaulting to ".coverage". `data_suffix` is appended (with a dot) to `data_file` to @@ -84,7 +84,7 @@ class Coverage(object): desired. `debug_file` is the file to write debug messages to, defaulting to stderr. - `coroutine` is a string indicating the coroutining library being used + `concurrency` is a string indicating the concurrency library being used in the measured code. Without this, coverage.py will get incorrect results. Valid strings are "greenlet", "eventlet", or "gevent", which are all equivalent. TODO: really? @@ -128,7 +128,7 @@ class Coverage(object): data_file=data_file, cover_pylib=cover_pylib, timid=timid, branch=branch, parallel=bool_or_none(data_suffix), source=source, omit=omit, include=include, debug=debug, - coroutine=coroutine, plugins=plugins, + concurrency=concurrency, plugins=plugins, ) # Create and configure the debugging controller. @@ -170,7 +170,7 @@ class Coverage(object): timid=self.config.timid, branch=self.config.branch, warn=self._warn, - coroutine=self.config.coroutine, + concurrency=self.config.concurrency, ) # Suffixes are a bit tricky. We want to use the data suffix only when -- cgit v1.2.1 From fe9ea16b667d2a89d94f09b52c58b54e209874c2 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 25 Sep 2014 06:40:09 -0400 Subject: Some error checking and more tests for concurrency control. --- coverage/control.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index 510ced7..cc1ad36 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -86,8 +86,8 @@ class Coverage(object): `concurrency` is a string indicating the concurrency library being used in the measured code. Without this, coverage.py will get incorrect - results. Valid strings are "greenlet", "eventlet", or "gevent", which - are all equivalent. TODO: really? + results. Valid strings are "greenlet", "eventlet", "gevent", or + "thread" (the default). `plugins` TODO. -- cgit v1.2.1 From 4de55988b9c873626712db0b83c494be246409a6 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 28 Sep 2014 18:42:30 -0400 Subject: Remove support for COVERAGE_OPTIONS environment variable. --- coverage/control.py | 1 - 1 file changed, 1 deletion(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index cc1ad36..fe4e5f1 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -118,7 +118,6 @@ class Coverage(object): self.config.from_file("setup.cfg", section_prefix="coverage:") # 3: from environment variables: - self.config.from_environment('COVERAGE_OPTIONS') env_data_file = os.environ.get('COVERAGE_FILE') if env_data_file: self.config.data_file = env_data_file -- cgit v1.2.1 From ca8403a7bd70f42dc6f97826e0e58bd607799da7 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 28 Sep 2014 19:44:20 -0400 Subject: Pragmas for uncovered code --- coverage/control.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index fe4e5f1..b2ec64a 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -550,10 +550,9 @@ class Coverage(object): # `save()` at the last minute so that the pid will be correct even # if the process forks. extra = "" - if _TEST_NAME_FILE: - f = open(_TEST_NAME_FILE) - test_name = f.read() - f.close() + if _TEST_NAME_FILE: # pragma: debugging + with open(_TEST_NAME_FILE) as f: + test_name = f.read() extra = "." + test_name data_suffix = "%s%s.%s.%06d" % ( socket.gethostname(), extra, os.getpid(), -- cgit v1.2.1