[TIP] coverage and multiprocessing

Ned Batchelder ned at nedbatchelder.com
Wed Sep 7 03:09:41 PDT 2016


Chris,

Do your workers exit cleanly?

--Ned.


On 9/6/16 5:19 PM, Chris Withers wrote:
> Hi All,
>
> I run my tests like this:
>
> coverage run --concurrency=multiprocessing --source myproject,tests -m
> nose && coverage report --skip-covered --show-missing
>
> Some of the code is only reached by being called by some
> multiprocessing.Pool workers, the pool being instantiated and fed by
> one of the functions under test.
>
> After running the above, I see:
>
> $ ls -lah .coverage*
> -rw-r--r--+ 1 chris  staff    25K  6 Sep 19:31 .coverage
> -rw-r--r--+ 1 chris  staff     0B  6 Sep 19:30
> .coverage.tweedledee.26019.082222
> -rw-r--r--+ 1 chris  staff     0B  6 Sep 19:30
> .coverage.tweedledee.26020.787224
> -rw-r--r--+ 1 chris  staff     0B  6 Sep 19:30
> .coverage.tweedledee.26021.467684
> -rw-r--r--+ 1 chris  staff     0B  6 Sep 19:30
> .coverage.tweedledee.26022.663538
>
> So, it looks like coverage is trying to record information in the
> worker processes by failing. What might be the issue and how can I fix
> it?
>
> cheers,
>
> Chris
>
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python




More information about the testing-in-python mailing list