File: test_doc.py

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

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