Forcing multiprocessing spawn on macOS
Following #138
From multiprocessing docs ,
"On macOS, the spawn start method is now the default..."
This causes LiveServer to throw a pickling error on py39. For now, we are explicitly forcing "fork" method for starting processes in LiveServer. As the docs specify, this is not adequate. Some research on this will be necessary and probably some changes in LiveServer.
The current way of forcing fork is not correct either,
if platform.system() == "Darwin":
multiprocessing.set_start_method("fork")
this is too blunt an instrument, and will even fail if set_start_method has already been called. I think pytest-flask should be doing the following:
if platform.system() == "Darwin":
multiprocessing = multiprocessing.get_context("fork")
Thanks for pointing it out @RazerM. The alternative seems reasonable and we would be glad to review a PR for this 👍🏻