Document the how to set new breakpoint() builtin in Python 3.7

This commit is contained in:
Aaron Meurer 2019-06-21 14:31:52 -06:00
parent b6f3afbd10
commit be8d3ffbbf
No known key found for this signature in database
GPG Key ID: 60ECCF21BA4D07FA

View File

@ -13,7 +13,18 @@ Or, if pudb is already imported, just this will suffice::
pu.db
Insert either of these snippets into the piece of code you want to debug, or
If you are using Python 3.7 or newer, you can add::
# Set breakpoint() in Python to call pudb
export PYTHONBREAKPOINT="pudb.set_trace"
in your ~/.bashrc. Then use::
breakpoint()
to start pudb.
Insert one of these snippets into the piece of code you want to debug, or
run the entire script with::
pudb my-script.py
@ -83,5 +94,3 @@ like so::
Note the need to pass --capture=no (or its synonym -s) as otherwise
pytest tries to manage the standard streams itself. (contributed by Antony Lee)