File: test_doc.py

package info (click to toggle)
ipy 1%3A0.70-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 172 kB
  • ctags: 165
  • sloc: python: 1,271; makefile: 17
file content (22 lines) | stat: -rwxr-xr-x 645 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python
import doctest
import sys
if hasattr(doctest, "testfile"):
    print "=== Test file: README ==="
    failure,  tests = doctest.testfile('README', optionflags=doctest.ELLIPSIS)
    if failure:
        sys.exit(1)

    print "=== Test file: test.rst ==="
    failure, tests = doctest.testfile('test/test.rst', optionflags=doctest.ELLIPSIS)
    if failure:
        sys.exit(1)

    print "=== Test IPy module ==="
    import IPy
    failure, tests = doctest.testmod(IPy)
    if failure:
        sys.exit(1)
else:
    sys.stderr.write("WARNING: doctest has no function testfile (before Python 2.4), unable to check README\n")