PyTest - Run each Test as a Mutlitprocessing Process PyTest - Run each Test as a Mutlitprocessing Process selenium selenium

PyTest - Run each Test as a Mutlitprocessing Process


I would still recommend using pytest-xdist. And, as you mentioned already because your tests mostly do network IO, it's ok to start pytest with (much) more parallel processes than you have cores (like 20), it will be still beneficial, as GIL will not be preventing the speedup from the parallelization.

So you run it like:

py.test tests -n<number>

The additional benefit of xdist is that you can easily scale your test run to multiple machines with no effort.For easier scaling among multiple machines, pytest-cloud can help a lot.