tests/test-doctest.py
author Siddharth Agarwal <sid0@fb.com>
Fri, 21 Mar 2014 16:09:17 -0700
changeset 20840 308344d80fe5
parent 20799 069bf1b821c8
child 21568 8dd17b19e722
permissions -rw-r--r--
subrepo: factor out Git version check to add doctests Followup to 6a2acb0d9352::e5641536e4d5.

# this is hack to make sure no escape characters are inserted into the output
import os, sys
if 'TERM' in os.environ:
    del os.environ['TERM']
import doctest

def testmod(name, optionflags=0, testtarget=None):
    __import__(name)
    mod = sys.modules[name]
    if testtarget is not None:
        mod = getattr(mod, testtarget)
    doctest.testmod(mod, optionflags=optionflags)

testmod('mercurial.changelog')
testmod('mercurial.dagparser', optionflags=doctest.NORMALIZE_WHITESPACE)
testmod('mercurial.dispatch')
testmod('mercurial.encoding')
testmod('mercurial.hg')
testmod('mercurial.hgweb.hgwebdir_mod')
testmod('mercurial.match')
testmod('mercurial.minirst')
testmod('mercurial.revset')
testmod('mercurial.store')
testmod('mercurial.subrepo')
testmod('mercurial.templatefilters')
testmod('mercurial.ui')
testmod('mercurial.url')
testmod('mercurial.util')
testmod('mercurial.util', testtarget='platform')
testmod('hgext.convert.cvsps')
testmod('hgext.convert.filemap')
testmod('hgext.convert.subversion')