Testing

This project supports two testing workflows:
  • Running tests directly with a single Python interpreter

  • Running the full multi-version and quality-check matrix using tox

Single-Python Workflow

Run serial unit tests:

pytest tests/

MPI tests are marked with the pytest marker @pytest.mark.mpi() and require the pytest-mpi plugin. Only tests decorated with this marker are executed when running MPI tests. For example, an MPI test function can be defined like this:

import pytest

@pytest.mark.mpi()
def test_parallel_function():
    ...

To run MPI tests with 8 processes:

mpiexec -n 8 pytest tests/ --only-mpi

Notes:

  • The --only-mpi flag is implemented via pytest-mpi.

  • Serial tests (without the marker) are skipped when using --only-mpi.

Note

On some shared systems, Open MPI may refuse to launch MPI jobs if the requested number of processes exceeds available CPU cores. In these cases, the --oversubscribe flag is required. The tox workflow handles this automatically, so you usually only need to worry about it when running mpiexec manually.