test-doctest.py
56 lines
| 1.6 KiB
| text/x-python
|
PythonLexer
/ tests / test-doctest.py
Mads Kiilerich
|
r7041 | # this is hack to make sure no escape characters are inserted into the output | ||
Pulkit Goyal
|
r28933 | |||
from __future__ import absolute_import | ||||
import doctest | ||||
import os | ||||
import sys | ||||
Yuya Nishihara
|
r31438 | |||
ispy3 = (sys.version_info[0] >= 3) | ||||
Patrick Mezard
|
r7078 | if 'TERM' in os.environ: | ||
Dirkjan Ochtman
|
r7184 | del os.environ['TERM'] | ||
Benoit Boissinot
|
r3232 | |||
Yuya Nishihara
|
r31438 | # TODO: migrate doctests to py3 and enable them on both versions | ||
def testmod(name, optionflags=0, testtarget=None, py2=True, py3=False): | ||||
if not (not ispy3 and py2 or ispy3 and py3): | ||||
return | ||||
Mads Kiilerich
|
r20047 | __import__(name) | ||
mod = sys.modules[name] | ||||
if testtarget is not None: | ||||
mod = getattr(mod, testtarget) | ||||
doctest.testmod(mod, optionflags=optionflags) | ||||
Sune Foldager
|
r14171 | |||
Augie Fackler
|
r27432 | testmod('mercurial.changegroup') | ||
Mads Kiilerich
|
r20047 | testmod('mercurial.changelog') | ||
Yuya Nishihara
|
r31518 | testmod('mercurial.color') | ||
Jun Wu
|
r31481 | testmod('mercurial.config') | ||
Mads Kiilerich
|
r20047 | testmod('mercurial.dagparser', optionflags=doctest.NORMALIZE_WHITESPACE) | ||
testmod('mercurial.dispatch') | ||||
testmod('mercurial.encoding') | ||||
Yuya Nishihara
|
r30560 | testmod('mercurial.formatter') | ||
Yuya Nishihara
|
r20799 | testmod('mercurial.hg') | ||
Mads Kiilerich
|
r20047 | testmod('mercurial.hgweb.hgwebdir_mod') | ||
testmod('mercurial.match') | ||||
Denis Laxalde
|
r31808 | testmod('mercurial.mdiff') | ||
Mads Kiilerich
|
r20047 | testmod('mercurial.minirst') | ||
Siddharth Agarwal
|
r24243 | testmod('mercurial.patch') | ||
FUJIWARA Katsunori
|
r21568 | testmod('mercurial.pathutil') | ||
Yuya Nishihara
|
r25306 | testmod('mercurial.parser') | ||
Yuya Nishihara
|
r31439 | testmod('mercurial.pycompat', py3=True) | ||
Yuya Nishihara
|
r31024 | testmod('mercurial.revsetlang') | ||
Yuya Nishihara
|
r30881 | testmod('mercurial.smartset') | ||
Mads Kiilerich
|
r20047 | testmod('mercurial.store') | ||
Siddharth Agarwal
|
r20840 | testmod('mercurial.subrepo') | ||
Mads Kiilerich
|
r20047 | testmod('mercurial.templatefilters') | ||
Yuya Nishihara
|
r25783 | testmod('mercurial.templater') | ||
Mads Kiilerich
|
r20047 | testmod('mercurial.ui') | ||
testmod('mercurial.url') | ||||
testmod('mercurial.util') | ||||
testmod('mercurial.util', testtarget='platform') | ||||
Eugene Baranov
|
r25805 | testmod('hgext.convert.convcmd') | ||
Mads Kiilerich
|
r20047 | testmod('hgext.convert.cvsps') | ||
Mads Kiilerich
|
r20048 | testmod('hgext.convert.filemap') | ||
Eugene Baranov
|
r25788 | testmod('hgext.convert.p4') | ||
Mads Kiilerich
|
r20419 | testmod('hgext.convert.subversion') | ||
Mads Kiilerich
|
r22546 | testmod('hgext.mq') | ||