pytest-faulthandler
raw JSON → 2.0.1 verified Fri May 01 auth: no python deprecated
pytest plugin that activates the faulthandler module during tests, enabling tracebacks for segfaults and crashes. Version 2.0.1 is a dummy package that no longer does anything because faulthandler is built into Python 3.3+. The plugin is effectively obsolete.
pip install pytest-faulthandler Common errors
error ERROR: Could not find a version that satisfies the requirement pytest-faulthandler (from versions: none) ↓
cause Package has been deprecated and may be removed from PyPI.
fix
Remove the dependency from requirements.txt; the built-in faulthandler module is sufficient for Python 3.3+.
error AttributeError: module 'faulthandler' has no attribute 'enable' ↓
cause Very old Python version (< 2.7) or missing faulthandler installation.
fix
Upgrade Python to 3.3+ or install the backported faulthandler package manually.
Warnings
deprecated pytest-faulthandler is obsolete for Python 3.3+ because faulthandler is part of the standard library. The package is now a dummy that does nothing. ↓
fix For Python 3.3+, remove the dependency. If you need fault handler tracebacks, use PYTHONFAULTHANDLER=1 or call faulthandler.enable() in conftest.py.
breaking Version 2.0.0 changed the package to a dummy that does nothing, breaking any tests that relied on the plugin's behavior (though normally it was transparent). ↓
fix Remove the dependency entirely for Python >=3.3; the built-in faulthandler module handles all cases.
gotcha Installing pytest-faulthandler on Python < 3.3 may still attempt to install the real faulthandler package from PyPI, which is no longer maintained. ↓
fix Pin to Python 3.3+ or avoid using this plugin entirely.
Imports
- pytest_faulthandler wrong
import pytest_faulthandlercorrectdo not import; plugin auto-activates when installed
Quickstart
# No special setup is needed; just install the package and run pytest.
# The fault handler will be activated automatically for Python < 3.3.
# For Python >= 3.3, faulthandler is built-in, so this plugin is a no-op.
# Example: run pytest normally
# pytest test_example.py