Skip to content

Commit 8e9ac7f

Browse files
committed
doctest tool
Small tool to run doctests on specified modules.
1 parent e32b511 commit 8e9ac7f

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

bin/doctest

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env python
2+
3+
import doctest
4+
import os
5+
import site
6+
import sys
7+
8+
# at least one module must be specified
9+
if len(sys.argv) == 1:
10+
print "No module specified."
11+
12+
# calculate the working directory
13+
sdir = os.path.abspath(__file__)
14+
wd = os.path.dirname(os.path.dirname(sdir))
15+
site.addsitedir(wd)
16+
17+
# for each module
18+
for module_path in sys.argv[1:]:
19+
print "Testing " + module_path
20+
doctest.testfile(module_path, module_relative=False)

0 commit comments

Comments
 (0)