diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-09-06 20:50:01 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-09-06 20:50:01 -0400 |
commit | 059fdf7e6f58dc6708f5023b95e4d4365a7b6225 (patch) | |
tree | 465394a263ce027c83e9be028ba953d61b9fa936 | |
parent | a6a9dd48f2a9eea57ba8e8b1602a229214e30c82 (diff) | |
download | python-coveragepy-git-059fdf7e6f58dc6708f5023b95e4d4365a7b6225.tar.gz |
Make debug=trace trace all the yes/no tracing decisions.
-rw-r--r-- | CHANGES.txt | 4 | ||||
-rw-r--r-- | coverage/control.py | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index f3b2e45c..b88b2ebc 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,8 +6,8 @@ Change history for Coverage.py ----- - Added the ``--debug`` switch to ``coverage run``. It accepts one option now, - ``notrace``, to log decisions not to trace files. I'm hoping this will help - people diagnose why their code isn't being traced. + ``trace``, to log decisions whether to trace files. I'm hoping this will + help people diagnose why their code isn't being traced. - Improved the branch coverage facility, fixing `issue 90`_ and `issue 175`_. diff --git a/coverage/control.py b/coverage/control.py index fa85be68..a767a264 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -41,7 +41,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=()): + source=None, omit=None, include=None, debug=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 @@ -287,9 +287,12 @@ class coverage(object): """ canonical, reason = self._should_trace_with_reason(filename, frame) - if not canonical: - if 'notrace' in self.config.debug: - sys.stderr.write("Not tracing %r: %s\n" % (filename, reason)) + if 'trace' in self.config.debug: + if not canonical: + msg = "Not tracing %r: %s\n" % (filename, reason) + else: + msg = "Tracing %r\n" % (filename,) + sys.stderr.write(msg) return canonical def _warn(self, msg): |