File: doctest_rsts.py

package info (click to toggle)
python-cogent 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 15,348 kB
  • sloc: python: 127,116; makefile: 85; ansic: 17; sh: 9
file content (16 lines) | stat: -rw-r--r-- 369 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python
import doctest, os, sys

"""
This will doctest all files ending with .rst in this directory.
"""

fl = sys.argv[1:]
if not fl:
    # find all files that end with rest
    fl = [fname for fname in os.listdir(os.getcwd()) if fname.endswith('.rst')]

    
for test in fl:
    doctest.testfile(test, 
    optionflags = doctest.ELLIPSIS, verbose=True)