summaryrefslogtreecommitdiff
path: root/coverage
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-01-31 18:41:12 -0500
committerNed Batchelder <ned@nedbatchelder.com>2016-01-31 18:41:12 -0500
commite2e3e0f3f43535a2bccf432ca0f7bba6191faa8e (patch)
tree266e30546faf101c7f5f27698c75198cb497564b /coverage
parentce17b1a6811e4cacbb7de5c876003347b0a91e65 (diff)
downloadpython-coveragepy-git-e2e3e0f3f43535a2bccf432ca0f7bba6191faa8e.tar.gz
Clean ups and docstrings
Diffstat (limited to 'coverage')
-rw-r--r--coverage/collector.py5
-rw-r--r--coverage/htmlfiles/style.css1
2 files changed, 5 insertions, 1 deletions
diff --git a/coverage/collector.py b/coverage/collector.py
index 3156b161..a296b227 100644
--- a/coverage/collector.py
+++ b/coverage/collector.py
@@ -38,10 +38,12 @@ class FileDisposition(object):
def should_start_context(frame):
+ """Who-Tests-What hack: Determine whether this frame begins a new who-context."""
fn_name = frame.f_code.co_name
if fn_name.startswith("test"):
return fn_name
+
class Collector(object):
"""Collects trace data.
@@ -326,6 +328,9 @@ class Collector(object):
self._start_tracer()
def switch_context(self, new_context):
+ """Who-Tests-What hack: switch to a new who-context."""
+ # Make a new data dict, or find the existing one, and switch all the
+ # tracers to use it.
data = self.contexts.setdefault(new_context, {})
for tracer in self.tracers:
tracer.data = data
diff --git a/coverage/htmlfiles/style.css b/coverage/htmlfiles/style.css
index 4214af5b..186b085b 100644
--- a/coverage/htmlfiles/style.css
+++ b/coverage/htmlfiles/style.css
@@ -342,4 +342,3 @@ td.text {
min-height: 3px;
width: 100%;
}
-