diff options
Diffstat (limited to 'coverage/collector.py')
-rw-r--r-- | coverage/collector.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/coverage/collector.py b/coverage/collector.py index 3156b16..a296b22 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 |