{"id":27303,"library":"pytest-mpi","title":"pytest-mpi","description":"pytest-mpi is a pytest plugin that provides fixtures and markers for tests requiring MPI (Message Passing Interface) support, enabling parallel test execution across multiple processes. Version 0.6 is the latest, with infrequent releases.","status":"active","version":"0.6","language":"python","source_language":"en","source_url":"https://github.com/johannes-kuhn/pytest-mpi","tags":["pytest","plugin","mpi","parallel","testing"],"install":[{"cmd":"pip install pytest-mpi","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for MPI communication in tests.","package":"mpi4py","optional":false},{"reason":"pytest-mpi is a pytest plugin.","package":"pytest","optional":false}],"imports":[{"wrong":"from pytest_mpi import mpi_skip","symbol":"MPIPlugin","correct":"from pytest_mpi import MPIPlugin"},{"symbol":"mpi_tmp_path","correct":"from pytest_mpi import mpi_tmp_path"},{"symbol":"mpi_tmpdir","correct":"from pytest_mpi import mpi_tmpdir"}],"quickstart":{"code":"import pytest\nfrom pytest_mpi import mpi_skip\n\n@mpi_skip(reason=\"Requires MPI\")\ndef test_mpi_example(mpi):\n    rank = mpi.Get_rank()\n    size = mpi.Get_size()\n    assert size > 0\n    print(f\"Hello from rank {rank} out of {size}\")\n\n# Run with: mpirun -n 4 pytest -v test_mpi.py","lang":"python","description":"Simple test using mpi fixture and mpi_skip decorator."},"warnings":[{"fix":"Always put @mpi_skip as the outermost decorator (right above def).","message":"The @mpi_skip decorator must be placed before @pytest.mark.parametrize to avoid skipping incorrectly.","severity":"gotcha","affected_versions":"all"},{"fix":"Use mpi fixture directly; check version changelogs for changes.","message":"The 'mpi' fixture may return a different MPI communicator object in future versions; currently it returns the MPI.COMM_WORLD.","severity":"deprecated","affected_versions":">=0.5"},{"fix":"Replace @mpi_gather and @mpi_allgather with @mpi_skip and manual MPI calls.","message":"pytest-mpi 0.5 removed support for MPI_Gather and MPI_Allgather fixtures; use mpi_skip with custom MPI calls instead.","severity":"breaking","affected_versions":"0.5+"}],"env_vars":null,"search_vec":"'0.6':32 'across':28 'enabl':24 'execut':27 'fixtur':13 'infrequ':37 'interfac':22 'latest':35 'marker':15 'messag':20 'mpi':3,6,19,41 'multipl':29 'parallel':25,42 'pass':21 'plugin':10,40 'process':30 'provid':12 'pytest':2,5,9,39 'pytest-mpi':1,4 'releas':38 'requir':18 'support':23 'test':17,26,43 'version':31","created_at":"2026-05-01T17:45:34.276928+00:00","updated_at":"2026-05-01T17:45:34.276928+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://pytest-mpi.readthedocs.io","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/pytest-mpi/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":null}}