Open graingert opened 4 years ago
billiard is a fork of the Python 2.7 multiprocessing package. The multiprocessing package itself is a renamed and updated version of R Oudkerk’s pyprocessing package. This standalone variant draws its fixes/improvements from python-trunk and provides additional bug fixes and improvements.
so it's helpful when testing python3 apps that use Celery, and python2 apps that require a multiprocessing module that actually works
as a side note, running
def _initializer():
from pytest_cov.embed import cleanup_on_sigterm
cleanup_on_sigterm
def _smoke_test_in_process():
assert str(3) == "3"
def test_ham():
import billiard as multiprocessing
with multiprocessing.Pool(processes=1, initializer=_initializer) as pool:
pool.apply(_smoke_test_in_process)
pool.join()
also results in assert str(3) == "3"
being missed
I do get 100% coverage when running the _initializer in the _smoke_test_in_process
def _initializer():
from pytest_cov.embed import cleanup_on_sigterm
cleanup_on_sigterm
def _smoke_test_in_process():
_initializer()
assert str(3) == "3"
def test_ham():
import billiard as multiprocessing
with multiprocessing.Pool(processes=1) as pool:
pool.apply(_smoke_test_in_process)
pool.join()
Well ok but does anyone except celery actually use billiard? I'd rather look at how celery is supported than its internals that no one else uses.
It's not a celery internal
and I get a report that
assert str(3) == "3"
isn't coveredwhen swapping
import billiard as multiprocessing
forimport multiprocessing
I get 100% coverage