Skip to main content
What does it do? Fixes line numbers so you can easily figure out where your doctest is failing, also fixes
the list command in pdb so it can properly list the source code for your doctest.

Other things may be broken so please send feedback.

add to your $HOME/.pdbrc:

import doctestpdbhacks

Here's an example of what it does:

$ cat doctesttest.py
def foo(a):
"""
>>> foo(1)
2
>>> import pdb; pdb.set_trace()
>>> foo(2)
2
"""
return a + 1

def _test():
import doctest
doctest.testmod()

if __name__ == "__main__":
_test()

# without doctestpdbhacks

$ python doctesttest.py
> <doctest __main__.foo[1]>(1)?()->None
-> import pdb; pdb.set_trace()
(Pdb) l
1 -> import pdb; pdb.set_trace()
[EOF]

# Turn on doctestpdbhacks:

$ echo >>$HOME/.pdbrc "import doctestpdbhacks"
$ python doctesttest.py
--Return--
> doctest @ doctesttest.py(5)?()->None
-> >>> import pdb; pdb.set_trace()
(Pdb) l
1 def foo(a):
2 """
3 >>> foo(1)
4 2
5 -> >>> import pdb; pdb.set_trace()
6 >>> foo(2)
7 2
8 """
9 return a + 1
10
11 def _test():

Metadata

Release files for doctestpdbhacks 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for doctestpdbhacks 0.1
File Size Uploaded Provenance Actions
doctestpdbhacks-0.1.tar.gz 2.1 kB Without provenance Details for doctestpdbhacks-0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for doctestpdbhacks 0.1
File Interpreter ABI Platform Actions
doctestpdbhacks-0.1-py2.4.egg Legacy Egg format - - Details for doctestpdbhacks-0.1-py2.4.egg

Total release size: 5.8 kB

Release files / doctestpdbhacks-0.1.tar.gz

Download URL doctestpdbhacks-0.1.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
251bbcb990410da79574872c5ffb3d15969ad8b3d49939bbe3ea26a60dfb2440
BLAKE2b-256 checksum
How to use checksums
31ce07efb065a26509f5d9dcac858354bc25614c327958de159f8ee72f3acd07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / doctestpdbhacks-0.1-py2.4.egg

Download URL doctestpdbhacks-0.1-py2.4.egg
Size 3.8 kB
Tags Egg
SHA-256 checksum
How to use checksums
b6f8adf403e57fd8e5a1652879cfe6eb33184c618b6153cac7861e92f1189794
BLAKE2b-256 checksum
How to use checksums
db8934eae121b8ccd2ad0cf97d10bed6c87fdab150d18aaad8ba3d12e86e4cb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for doctestpdbhacks 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page