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.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Source

File details

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

File metadata

File hashes

Hashes for ipython_doctester-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e4ade05d4b6e612dccfe00d0f440bf0dc16eaa3b14504cc57fff2a122c8b3533
MD5 e236f5917584b2f82fac2cfd24389520
BLAKE2b-256 c69b2f18115428ad776a65e4817f63438ce415c22a17d096e210a9905d893325

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ipython_doctester-0.2.1-py2.7.egg
Algorithm Hash digest
SHA256 931bb9c19213cd279500078e3ffaaaf7169b1698b5bb3784161524bf4b61ed02
MD5 ed24ad6a1dbefc1932b332b73cd2516e
BLAKE2b-256 88ee0273515e033c10d0517e8e509bce142ff62067f3460db67f41b7ba203f55

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