Skip to content

faulthandler and pv.OFF_SCREEN as Defaults #276

Description

@banesullivan

Two module-level settings in PyVista's conftest are easy to forget but important:

  1. 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.

  2. 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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions