tests/test-doctest.py
author Lucas Moscovicz <lmoscovicz@fb.com>
Thu, 30 Jan 2014 15:39:56 -0800
changeset 20452 a685d9870eb5
parent 20419 e61a8395c3c1
child 20799 069bf1b821c8
permissions -rw-r--r--
revset: added lazyset implementation to desc revset Performance benchmarking: $ time hg log -qr "first(desc(hg))" changeset: 0:9117c6561b0b real 0m2.210s user 0m2.158s sys 0m0.049s $ time ./hg log -qr "first(desc(hg))" changeset: 0:9117c6561b0b real 0m0.171s user 0m0.131s sys 0m0.035s

# 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.hgweb.hgwebdir_mod')
testmod('mercurial.match')
testmod('mercurial.minirst')
testmod('mercurial.revset')
testmod('mercurial.store')
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')