summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2011-04-25 22:00:36 -0400
committerNed Batchelder <ned@nedbatchelder.com>2011-04-25 22:00:36 -0400
commit3ec7ec05e074911e7eba7f8a4e0cb3682f15b0a9 (patch)
tree0732d21d3f5589d563e429afbe26a5359ab5c226 /coverage/control.py
parenta64cdfd45a453782d4277523bdafd72bbdb44143 (diff)
downloadpython-coveragepy-3ec7ec05e074911e7eba7f8a4e0cb3682f15b0a9.tar.gz
Since people make this mistake, and it's mysterious: accept a single string for omit and include.
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/coverage/control.py b/coverage/control.py
index dd65661..cee073e 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -64,7 +64,8 @@ class coverage(object):
measured.
`include` and `omit` are lists of filename patterns. Files that match
- `include` will be measured, files that match `omit` will not.
+ `include` will be measured, files that match `omit` will not. Each
+ will also accept a single string argument.
"""
from coverage import __version__
@@ -95,6 +96,10 @@ class coverage(object):
self.config.data_file = env_data_file
# 4: from constructor arguments:
+ if isinstance(omit, string_class):
+ omit = [omit]
+ if isinstance(include, string_class):
+ include = [include]
self.config.from_args(
data_file=data_file, cover_pylib=cover_pylib, timid=timid,
branch=branch, parallel=bool_or_none(data_suffix),