Python Code Coverage and Multiprocessing

非 Y 不嫁゛ 提交于 2019-12-04 22:51:31
David Ketcheson

Coverage 4.0 includes a command-line option --concurrency=multiprocessing to deal with this. You must use coverage combine afterward. For instance, if your tests are in regression_tests.py, then you would simply do this at the command line:

coverage run --concurrency=multiprocessing regression_tests.py
coverage combine

I've had spent some time trying to make sure coverage works with multiprocessing.Pool, but it never worked.

I have finally made a fix that makes it work - would be happy if someone directed me if I am doing something wrong.

https://gist.github.com/andreycizov/ee59806a3ac6955c127e511c5e84d2b6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!