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.

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

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

Uploaded Source

Built Distribution

ipython_doctester-0.2.2-py2.7.egg (7.2 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for ipython_doctester-0.2.2.tar.gz
Algorithm Hash digest
SHA256 b189c22d888b505e8b273d787516c5b44e369f172242424fd313ac4830fb36df
MD5 af9fdacc95dac363488e42f2ca7cb163
BLAKE2b-256 8c35a669f282a83be991bfe0718bab4b0ef97555dbd43a534c5ace37b20f9fe2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ipython_doctester-0.2.2-py2.7.egg
Algorithm Hash digest
SHA256 815058ac0da291ba17ad7652a4baab9d07a136a430bfa89835f9a1969bb9c527
MD5 801c187e41c23c4a0a854495c706a57f
BLAKE2b-256 3ef51563326fc4d40efcb9e34148bdb2ffffec3e3f62c8152d8ae11d29d3fa21

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