Skip to main content

ipython_doctester

Lets you run the doctests of a single class or function at a time. Useful for tutorials based on the IPython Notebook, using doctests for student feeback.

Install with pip install ipython_doctester, or navigate to this directory and run:

python setup.py install

Use

Run ipython notebook, then start your notebook with this import:

In [1]: from ipython_doctester import test

In each subsequent cell, set up objects with their doctests, and with absent (or flawed) function bodies, and decorate them with @test:

In [2]: @test
        def square(x):
            '''
            >>> f(2)
            4
            '''

Tests will run on each cell as it is executed.

If you want to track students’ progress through a notebook in a classroom setting, you can; see http://ipython-docent.appspot.com/ for instructions.

If no doctests are found in the function’s docstring, the program will look for a file ./docstrings/<function name>.txt, append that to the function’s docstring, and check for doctests again. This can be used to keep the presence of the docstrings from confusing students.

Development

https://github.com/catherinedevlin/ipython_doctester

Thanks to

Brian Granger for technical advice

Metadata

Release files for ipython_doctester 0.3.0

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

Source distribution (sdist)

Source distribution for ipython_doctester 0.3.0
File Size Uploaded
ipython_doctester-0.3.0.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ipython_doctester 0.3.0
File Interpreter ABI Platform
ipython_doctester-0.3.0-py2.7.egg Legacy Egg format - - Details

Total release size: 11.9 kB

Release files / ipython_doctester-0.3.0.tar.gz

Download URL ipython_doctester-0.3.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e14bc3209cf3c613cea78db5a0075603aca7d842a2a4e9d5549b7d04ad48628f
BLAKE2b-256 checksum
How to use checksums
4d73832efa29ac56f55c4e24e7c0b67e090a00e052366490daca14d9832bc5f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ipython_doctester-0.3.0-py2.7.egg

Download URL ipython_doctester-0.3.0-py2.7.egg
Size 7.9 kB
Tags Egg
SHA-256 checksum
How to use checksums
96f136704480f8b213f56ee89f8405a91b5a50188b8d0c74566942459247ba1a
BLAKE2b-256 checksum
How to use checksums
9d390877e36bf82a1614e95fc31934143a8695e5e5fb1a5c70395ac57edf1a90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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