like sebastien I started to use pytest_easyMPI, but sadly this module does not seem to be maintained. I prefer to use pytest-isolate-mpi (https://github.com/dlr-sp/pytest-isolate-mpi) which is more up-to-date