File: doctest_rsts.py

package info (click to toggle)
python-cogent 1.5.3-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 16,424 kB
  • ctags: 24,343
  • sloc: python: 134,200; makefile: 100; ansic: 17; sh: 10
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)