pytest-pycharm
raw JSON → 0.7.0 verified Fri May 01 auth: no python maintenance
Plugin for pytest to drop into PyCharm debugger on uncaught exceptions. Version 0.7.0 is the latest, with no recent updates. The plugin is in maintenance mode.
pip install pytest-pycharm Common errors
error ModuleNotFoundError: No module named 'pytest_pycharm' ↓
cause Missing installation or incorrect import path.
fix
pip install pytest-pycharm. The plugin registers itself as a pytest plugin; no import needed.
error Error: unrecognized arguments: --pycharm ↓
cause Plugin not installed or not activated.
fix
Ensure pytest-pycharm is installed (pip list | grep pytest-pycharm) and run pytest with the --pycharm flag.
Warnings
gotcha The plugin only works with PyCharm debug server; you must have PyCharm running with a Python Debug Server configured. ↓
fix Set up PyCharm's Remote Debug configuration (Run > Edit Configurations > Python Debug Server) and note the port.
gotcha The plugin does not automatically connect; you must manually start the PyCharm debug server before running tests. ↓
fix In PyCharm, run the 'Python Debug Server' configuration before executing pytest.
Quickstart
import sys
import os
os.environ.setdefault('PYCHARM_DEBUG_PORT', '12345')
# Run pytest with --pycharm
# ptest --pycharm tests/