put this line inside  for  could be an issue i write a really small test  only one process can finished create the pool outside  for  can work around although it might be a little stupid pool multiprocessing pool times for i in range times small test can pass but unit test still hang  