DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
conftest.py
Go to the documentation of this file.
1"""Root conftest — ensures the in-tree ``python/`` directory is importable.
2
3With this file ``pytest test/`` (or ``python -m pytest test/``) works
4without ``pip install -e .`` as long as the C++ shared libraries and
5pybind11 ``.so`` modules have been built and installed into the
6``python/DNDSR/`` tree via::
7
8 cmake --build build -t dnds_pybind11 geom_pybind11 cfv_pybind11 eulerP_pybind11 -j32
9 cmake --install build --component py
10"""
11
12from __future__ import annotations
13
14import sys
15from pathlib import Path
16
17import pytest
18
19_PYTHON_DIR = str(Path(__file__).resolve().parent.parent / "python")
20if _PYTHON_DIR not in sys.path:
21 sys.path.insert(0, _PYTHON_DIR)
22
23from DNDSR import DNDS # noqa: E402
24
25
26@pytest.fixture
27def mpi():
28 """Shared MPI fixture — creates a world-scope MPIInfo."""
29 world = DNDS.MPIInfo()
30 world.setWorld()
31 yield world
Lightweight bundle of an MPI communicator and the calling rank's coordinates.
Definition MPI.hpp:215