Two module-level settings in PyVista's conftest are easy to forget but important:
-
faulthandler.enable() gives you a Python traceback on SIGSEGV/SIGBUS instead of a bare "Segmentation fault" message. This is the difference between a debuggable crash and an opaque one.
-
pv.OFF_SCREEN = True is required for headless test environments. Every PyVista downstream project sets this independently. Some forget and get hanging tests in CI.
Proposal
pytest-pyvista should set both automatically when loaded as a plugin:
import faulthandler
faulthandler.enable()
import pyvista as pv
pv.OFF_SCREEN = True
The OFF_SCREEN setting should be overridable via config for the rare case where someone wants on-screen tests:
[tool.pytest.ini_options]
pyvista_off_screen = false # default: true
Related issues
- pyvista#7891 Segfault on self-hosted CI runners (closed, faulthandler was key to diagnosis)
- pyvista#1186 Disable the faulthandler warning (closed, discusses faulthandler noise in test output)
- pyvista#3746
_system_supports_plotting() unreliable (open, motivates OFF_SCREEN default)
Two module-level settings in PyVista's conftest are easy to forget but important:
faulthandler.enable()gives you a Python traceback on SIGSEGV/SIGBUS instead of a bare "Segmentation fault" message. This is the difference between a debuggable crash and an opaque one.pv.OFF_SCREEN = Trueis required for headless test environments. Every PyVista downstream project sets this independently. Some forget and get hanging tests in CI.Proposal
pytest-pyvista should set both automatically when loaded as a plugin:
The
OFF_SCREENsetting should be overridable via config for the rare case where someone wants on-screen tests:Related issues
_system_supports_plotting()unreliable (open, motivates OFF_SCREEN default)