summaryrefslogtreecommitdiff
path: root/coverage/data.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-07-25 12:00:03 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-07-25 12:00:03 -0400
commit8c3afce49a248b478072a9efdab4cc4a8b794f33 (patch)
tree87a09aa21ddd6a1153b2a9e496c294a222572906 /coverage/data.py
parent8e81a1b6feddb2a0642d7991ac35c7419f570bb6 (diff)
downloadpython-coveragepy-git-8c3afce49a248b478072a9efdab4cc4a8b794f33.tar.gz
Add more to the data docs
Diffstat (limited to 'coverage/data.py')
-rw-r--r--coverage/data.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/coverage/data.py b/coverage/data.py
index e8aaf1c0..3f2c371e 100644
--- a/coverage/data.py
+++ b/coverage/data.py
@@ -148,6 +148,9 @@ class CoverageData(object):
If the file was not measured, returns None. A file might be measured,
and have no lines executed, in which case an empty list is returned.
+ If the file was executed, returns a list of integers, the line numbers
+ executed in the file. The list is in no particular order.
+
"""
if self._arcs:
if filename in self._arcs:
@@ -163,6 +166,16 @@ class CoverageData(object):
If the file was not measured, returns None. A file might be measured,
and have no arcs executed, in which case an empty list is returned.
+ If the file was executed, returns a list of 2-tuples of integers. Each
+ pair is a starting line number and an ending line number for a
+ transition from one line to another. The list is in no particular
+ order.
+
+ Negative numbers have special meaning. If the starting line number is
+ -N, it represents an entry to the code object that starts at line N.
+ If the ending ling number is -N, it's an exit from the code object that
+ starts at line N.
+
"""
if filename in self._arcs:
return self._arcs[filename]
@@ -181,8 +194,8 @@ class CoverageData(object):
"""
# Because the vast majority of files involve no plugin, we don't store
- # them explicitly in self._file_tracers. Check the measured data instead
- # to see if it was a known file with no plugin.
+ # them explicitly in self._file_tracers. Check the measured data
+ # instead to see if it was a known file with no plugin.
if filename in (self._arcs or self._lines):
return self._file_tracers.get(filename, "")
return None