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

Uploaded Source

Built Distribution

ipython_doctester-0.1.1-py2.7.egg (5.4 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for ipython_doctester-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d59a1553f4562399276812b58bdc1600878001e45a2cf4072bde7bf659982b3f
MD5 6360d1f81f75268bb8d33e54151b7202
BLAKE2b-256 3a4dad9b5c8462d84e463516b868f6d7de4e025c018a9af626d68eb042a4155e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ipython_doctester-0.1.1-py2.7.egg
Algorithm Hash digest
SHA256 e6fd7b6cf8f254a6bd10aac3ff87a1334206948498b784032aaab29d8a28f381
MD5 e5a3a91fe79a3d40eeb2282c309239ac
BLAKE2b-256 32ac924b0cabc542b64ddf0896d3e2ecdcb57ec904e2798a0b4642cf77899e80

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