##// END OF EJS Templates
tests: allow running doctests selectively on Python 3...
Yuya Nishihara -
r31438:82350f7f default
parent child Browse files
Show More
@@ -1,46 +1,52
1 1 # this is hack to make sure no escape characters are inserted into the output
2 2
3 3 from __future__ import absolute_import
4 4
5 5 import doctest
6 6 import os
7 7 import sys
8
9 ispy3 = (sys.version_info[0] >= 3)
10
8 11 if 'TERM' in os.environ:
9 12 del os.environ['TERM']
10 13
11 def testmod(name, optionflags=0, testtarget=None):
14 # TODO: migrate doctests to py3 and enable them on both versions
15 def testmod(name, optionflags=0, testtarget=None, py2=True, py3=False):
16 if not (not ispy3 and py2 or ispy3 and py3):
17 return
12 18 __import__(name)
13 19 mod = sys.modules[name]
14 20 if testtarget is not None:
15 21 mod = getattr(mod, testtarget)
16 22 doctest.testmod(mod, optionflags=optionflags)
17 23
18 24 testmod('mercurial.changegroup')
19 25 testmod('mercurial.changelog')
20 26 testmod('mercurial.dagparser', optionflags=doctest.NORMALIZE_WHITESPACE)
21 27 testmod('mercurial.dispatch')
22 28 testmod('mercurial.encoding')
23 29 testmod('mercurial.formatter')
24 30 testmod('mercurial.hg')
25 31 testmod('mercurial.hgweb.hgwebdir_mod')
26 32 testmod('mercurial.match')
27 33 testmod('mercurial.minirst')
28 34 testmod('mercurial.patch')
29 35 testmod('mercurial.pathutil')
30 36 testmod('mercurial.parser')
31 37 testmod('mercurial.revsetlang')
32 38 testmod('mercurial.smartset')
33 39 testmod('mercurial.store')
34 40 testmod('mercurial.subrepo')
35 41 testmod('mercurial.templatefilters')
36 42 testmod('mercurial.templater')
37 43 testmod('mercurial.ui')
38 44 testmod('mercurial.url')
39 45 testmod('mercurial.util')
40 46 testmod('mercurial.util', testtarget='platform')
41 47 testmod('hgext.convert.convcmd')
42 48 testmod('hgext.convert.cvsps')
43 49 testmod('hgext.convert.filemap')
44 50 testmod('hgext.convert.p4')
45 51 testmod('hgext.convert.subversion')
46 52 testmod('hgext.mq')
General Comments 0
You need to be logged in to leave comments. Login now