diff options
-rw-r--r-- | coverage/collector.py | 4 | ||||
-rw-r--r-- | coverage/control.py | 4 | ||||
-rw-r--r-- | metacov.ini | 1 |
3 files changed, 3 insertions, 6 deletions
diff --git a/coverage/collector.py b/coverage/collector.py index 01acb78d..a042357f 100644 --- a/coverage/collector.py +++ b/coverage/collector.py @@ -256,10 +256,6 @@ class Collector(object): if hasattr(tracer, 'should_start_context'): tracer.should_start_context = self.should_start_context tracer.switch_context = self.switch_context - elif self.should_start_context: - raise CoverageException( - "Can't support dynamic contexts with {}".format(self.tracer_name()) - ) fn = tracer.start() self.tracers.append(tracer) diff --git a/coverage/control.py b/coverage/control.py index 5194b5d6..fdd1556e 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -561,8 +561,8 @@ class Coverage(object): .. versionadded:: 5.0 """ - if not self._started: - raise CoverageException( # pragma: only jython + if not self._started: # pragma: part started + raise CoverageException( "Cannot switch context, coverage is not started" ) self._collector.switch_context(new_context) diff --git a/metacov.ini b/metacov.ini index 52cb7200..daabbf82 100644 --- a/metacov.ini +++ b/metacov.ini @@ -71,6 +71,7 @@ exclude_lines = partial_branches = pragma: part covered pragma: if failure + pragma: part started if env.TESTING: if .* env.JYTHON if .* env.IRONPYTHON |