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
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
Built Distribution
File details
Details for the file ipython_doctester-0.1.1.tar.gz
.
File metadata
- Download URL: ipython_doctester-0.1.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d59a1553f4562399276812b58bdc1600878001e45a2cf4072bde7bf659982b3f |
|
MD5 | 6360d1f81f75268bb8d33e54151b7202 |
|
BLAKE2b-256 | 3a4dad9b5c8462d84e463516b868f6d7de4e025c018a9af626d68eb042a4155e |
File details
Details for the file ipython_doctester-0.1.1-py2.7.egg
.
File metadata
- Download URL: ipython_doctester-0.1.1-py2.7.egg
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6fd7b6cf8f254a6bd10aac3ff87a1334206948498b784032aaab29d8a28f381 |
|
MD5 | e5a3a91fe79a3d40eeb2282c309239ac |
|
BLAKE2b-256 | 32ac924b0cabc542b64ddf0896d3e2ecdcb57ec904e2798a0b4642cf77899e80 |