Skip to main content

Run doctests in individual IPython Notebook cells

Project description

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.

Development

https://github.com/catherinedevlin/ipython_doctester

Thanks to

Brian Granger for technical advice

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipython_doctester-0.2.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

ipython_doctester-0.2.0-py2.7.egg (5.9 kB view details)

Uploaded Source

File details

Details for the file ipython_doctester-0.2.0.tar.gz.

File metadata

File hashes

Hashes for ipython_doctester-0.2.0.tar.gz
Algorithm Hash digest
SHA256 941dc75e51c78b735c9dc5571e327eb7729c34abae6f8e39520780c51f5a942a
MD5 0abdb778928d8f9ed0ae479473d8f867
BLAKE2b-256 c5a3f9c1619a2461a0d98665e8591df657af5cfa38c52b1be285d512f3f1109e

See more details on using hashes here.

File details

Details for the file ipython_doctester-0.2.0-py2.7.egg.

File metadata

File hashes

Hashes for ipython_doctester-0.2.0-py2.7.egg
Algorithm Hash digest
SHA256 9e83ab83043860b4ee3d15a692ced7da8b6ac62f0fe91d789776b70442a03503
MD5 30add7e312c2c2cf57c95c2d4ab8c78e
BLAKE2b-256 0a267cf9af0a0e39d50b5bc3ec4280a090aef1b70e2b43df9c347eed081ed28f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page