<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Joe, I read your first email last night, and mulling over the
possibilities, concluded that the problem was just as you have
diagnosed.  I awoke this morning ready to fix it, and found you already
had!  I'll apply the patch today...<br>
<br>
Thanks.<br>
<br>
--Ned.<br>
<br>
Joe Malicki wrote:
<blockquote
 cite="mid:7860171003150210n14b9714bt3dde9f01ccfe3f80@mail.gmail.com"
 type="cite">
  <pre wrap="">I dug in enough to realize it seemed to be a fairly fatal flaw of how
parallel=True was implemented.

Issue and provisional patch that seem to work for me here:

<a class="moz-txt-link-freetext" href="http://bitbucket.org/ned/coveragepy/issue/56/">http://bitbucket.org/ned/coveragepy/issue/56/</a>

Thanks!
Joe

On Sun, Mar 14, 2010 at 7:38 PM, Joe Malicki <a class="moz-txt-link-rfc2396E" href="mailto:jmalicki@gmail.com">&lt;jmalicki@gmail.com&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Does anyone have a recipe of getting coverage.py to work across a fork()?

I was trying to use coverage 3.3.1 with python 2.6 and
multiprocessing, and couldn't figure out how to get it to trace the
child.
Attached is a simple test program to illustrate behavior and show
things I tried.

Is there another way of doing this I didn't come across, or is this
something that needs to be hacked into coverage?

Thanks!
Joe

with coverage run -p testcover.py, i see:

jmalicki@boott-spur:~$ coverage combine
jmalicki@boott-spur:~$ coverage report -m
Name        Stmts   Exec  Cover   Missing
-----------------------------------------
testcover      19     10    52%   10-20, 27

When I explicitly call stop: coverage run -p testcover.py -t
Child!
Traceback (most recent call last):
 File "testcover.py", line 32, in &lt;module&gt;
   main(sys.argv)
 File "testcover.py", line 27, in main
   child(args)
 File "testcover.py", line 18, in child
   coverage.stop()
 File "/usr/local/lib/python2.6/dist-packages/coverage-3.3.1-py2.6-linux-x86_64.egg/coverage/__init__.py",
line 39, in wrapper
   return getattr(_the_coverage, name)(*args, **kwargs)
 File "/usr/local/lib/python2.6/dist-packages/coverage-3.3.1-py2.6-linux-x86_64.egg/coverage/control.py",
line 212, in stop
   self.collector.stop()
 File "/usr/local/lib/python2.6/dist-packages/coverage-3.3.1-py2.6-linux-x86_64.egg/coverage/collector.py",
line 214, in stop
   assert self._collectors[-1] is self
AssertionError

coverage run -p testcover.py -s
Child!
jmalicki@boott-spur:~$ coverage combine
coverage report -m:
Name        Stmts   Exec  Cover   Missing
-----------------------------------------
testcover      19     10    52%   10-20, 27

    </pre>
  </blockquote>
  <pre wrap=""><!---->
_______________________________________________
testing-in-python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a>
<a class="moz-txt-link-freetext" href="http://lists.idyll.org/listinfo/testing-in-python">http://lists.idyll.org/listinfo/testing-in-python</a>
  </pre>
</blockquote>
</body>
</html>