-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathREADME.txt
More file actions
50 lines (35 loc) · 1.33 KB
/
README.txt
File metadata and controls
50 lines (35 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
=================
ipython_doctester
=================
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.
If no doctests are found in the function's docstring, the program will look
for a file ``./docstrings/<function name>.txt``, append that to the function's
docstring, and check for doctests again. This can be used to keep the presence
of the docstrings from confusing students.
Development
===========
https://github.com/catherinedevlin/ipython_doctester
Thanks to
=========
Brian Granger for technical advice