nested coverage instances causes assertation error

Issue #296 resolved
space one created an issue
from coverage import coverage
c = coverage()
c2 = coverage()

causes: Traceback (most recent call last): File "", line 6, in <module> c2.stop() File "/usr/lib/python2.7/site-packages/coverage/", line 410, in stop self.collector.stop() File "/usr/lib/python2.7/site-packages/coverage/", line 294, in stop assert self._collectors[-1] is self AssertionError

Comments (4)

  1. Ned Batchelder repo owner

    @spaceone Is there a use case here? Why would you want to run coverage like this?

  2. Ned Batchelder repo owner

    I notice now in your code above that you stopped c2 without having ever started it. When I add c2.start() to your sample, it runs without error. I don't know that you will get the nested behavior you want, but at least it doesn't raise an assertion.

  3. Log in to comment