OBSOLETE this project has been obsoleted by modern tooling with superior editor integration based on DAP. It will disappear from PyPI on or soon after January 1 2021. Maintenance will cease with the release of pytest 7.
Some possibilities worth trying:
This plugin merely launches PDB, the built-in GDB-style debugger. It does so
by adding a command-line option to specify an initial breakpoint. [1]
Included are add-ons for two traditional text editors, Vim and Emacs. They
help fire up the debugger and fast-forward to the point of interest. If you
already have a solid workflow with breakpoint()
snippets and/or the
--trace
and --pdb
options, there's nothing to see here.
This basically does ...
$ pytest --trace test_spam.py::test_foo ... (pdb) until 42with a few minor conveniences sprinkled in
Don't install
Unlike a proper pytest plugin, this isn't meant to be installed as a Python
package. [2] The editor will instead inject an isolated installation via
PYTHONPATH
, but only while in use (no internet connection required).
TODOs
- Support remote operation
- Support arbitrary test names via the
"python_functions"
andpython_classes
options- Ensure proper breaking in overridden fixtures
- Support FreeBSD (postponed/abandoned)
- Ditch helpers in favor of client/server model (postponed/abandoned)
Notes/caveats
- This is only meant to run under Linux but has been reported to work on MacOS
- It mainly exists for its author to learn about pytest, a decent understanding of which continues to evade
[1] | E.g., pytest --break=test_file.py:42 |
[2] | ... unless used as a standalone command-line option |