Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
executable file 27 lines (21 sloc) 0.63 kB
#!/usr/bin/env python
import doctest
import unittest
import sys
def test_suite(docs):
suite = unittest.TestSuite()
for doc in docs:
suite.addTest(doctest.DocFileSuite(doc, optionflags=flags()))
return suite
def flags():
flags = doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS
if sys.version_info >= (3,):
flags |= doctest.IGNORE_EXCEPTION_DETAIL
return flags
def run(docs):
suite = test_suite(docs)
runner = unittest.TextTestRunner(verbosity=2)
result = runner.run(suite)
sys.exit(int(bool(result.failures or result.errors)))
if __name__ == '__main__':
run(sys.argv)
Jump to Line
Something went wrong with that request. Please try again.