Issue #296 resolved

nested coverage instances causes assertation error

space one
created an issue
from coverage import coverage
c = coverage()
c.start()
c2 = coverage()
c2.stop()
c.stop()

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

Comments (4)

  1. 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.

  2. Log in to comment