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.2.1.tar.gz
.
File metadata
- Download URL: ipython_doctester-0.2.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4ade05d4b6e612dccfe00d0f440bf0dc16eaa3b14504cc57fff2a122c8b3533 |
|
MD5 | e236f5917584b2f82fac2cfd24389520 |
|
BLAKE2b-256 | c69b2f18115428ad776a65e4817f63438ce415c22a17d096e210a9905d893325 |
File details
Details for the file ipython_doctester-0.2.1-py2.7.egg
.
File metadata
- Download URL: ipython_doctester-0.2.1-py2.7.egg
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 931bb9c19213cd279500078e3ffaaaf7169b1698b5bb3784161524bf4b61ed02 |
|
MD5 | ed24ad6a1dbefc1932b332b73cd2516e |
|
BLAKE2b-256 | 88ee0273515e033c10d0517e8e509bce142ff62067f3460db67f41b7ba203f55 |