diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2014-09-25 06:40:09 -0400 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2014-09-25 06:40:09 -0400 |
| commit | fe9ea16b667d2a89d94f09b52c58b54e209874c2 (patch) | |
| tree | 10c82eec6405690ce91bd8c9636c30522ebb74eb /coverage | |
| parent | ea3b37c5b62d835ab301d7f35da72d3e4b2f3292 (diff) | |
| download | python-coveragepy-fe9ea16b667d2a89d94f09b52c58b54e209874c2.tar.gz | |
Some error checking and more tests for concurrency control.
Diffstat (limited to 'coverage')
| -rw-r--r-- | coverage/cmdline.py | 5 | ||||
| -rw-r--r-- | coverage/collector.py | 4 | ||||
| -rw-r--r-- | coverage/control.py | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py index 51aa5fe..58f4817 100644 --- a/coverage/cmdline.py +++ b/coverage/cmdline.py @@ -19,9 +19,12 @@ class Opts(object): '', '--branch', action='store_true', help="Measure branch coverage in addition to statement coverage." ) + CONCURRENCY_CHOICES = ["thread", "gevent", "greenlet", "eventlet"] concurrency = optparse.make_option( '', '--concurrency', action='store', metavar="LIB", - help="Properly measure code using a concurrency library." + choices=CONCURRENCY_CHOICES, + help="Properly measure code using a concurrency library. " + "Valid values are: %s." % ", ".join(CONCURRENCY_CHOICES) ) debug = optparse.make_option( '', '--debug', action='store', metavar="OPTS", diff --git a/coverage/collector.py b/coverage/collector.py index 0731824..9c6288c 100644 --- a/coverage/collector.py +++ b/coverage/collector.py @@ -68,7 +68,9 @@ class Collector(object): `warn` is a warning function, taking a single string message argument, to be used if a warning needs to be issued. - TODO: `concurrency` + `concurrency` is a string indicating the concurrency library in use. + Valid values are "greenlet", "eventlet", "gevent", or "thread" (the + default). """ self.should_trace = should_trace 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. |
