Mercurial > public > mercurial-scm > hg
comparison tests/test-doctest.py @ 20047:10a7d2bcb81b
tests: make doctest test runner less verbose
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Sun, 17 Nov 2013 11:16:59 -0500 |
parents | f01ae031f84c |
children | da99ebd35f00 |
comparison
equal
deleted
inserted
replaced
20046:6a03695fa72a | 20047:10a7d2bcb81b |
---|---|
1 # this is hack to make sure no escape characters are inserted into the output | 1 # this is hack to make sure no escape characters are inserted into the output |
2 import os | 2 import os, sys |
3 if 'TERM' in os.environ: | 3 if 'TERM' in os.environ: |
4 del os.environ['TERM'] | 4 del os.environ['TERM'] |
5 import doctest | 5 import doctest |
6 | 6 |
7 import mercurial.util | 7 def testmod(name, optionflags=0, testtarget=None): |
8 doctest.testmod(mercurial.util) | 8 __import__(name) |
9 # Only run doctests for the current platform | 9 mod = sys.modules[name] |
10 doctest.testmod(mercurial.util.platform) | 10 if testtarget is not None: |
11 mod = getattr(mod, testtarget) | |
12 doctest.testmod(mod, optionflags=optionflags) | |
11 | 13 |
12 import mercurial.changelog | 14 testmod('mercurial.changelog') |
13 doctest.testmod(mercurial.changelog) | 15 testmod('mercurial.dagparser', optionflags=doctest.NORMALIZE_WHITESPACE) |
14 | 16 testmod('mercurial.dispatch') |
15 import mercurial.dagparser | 17 testmod('mercurial.encoding') |
16 doctest.testmod(mercurial.dagparser, optionflags=doctest.NORMALIZE_WHITESPACE) | 18 testmod('mercurial.hgweb.hgwebdir_mod') |
17 | 19 testmod('mercurial.match') |
18 import mercurial.match | 20 testmod('mercurial.minirst') |
19 doctest.testmod(mercurial.match) | 21 testmod('mercurial.revset') |
20 | 22 testmod('mercurial.store') |
21 import mercurial.store | 23 testmod('mercurial.templatefilters') |
22 doctest.testmod(mercurial.store) | 24 testmod('mercurial.ui') |
23 | 25 testmod('mercurial.url') |
24 import mercurial.ui | 26 testmod('mercurial.util') |
25 doctest.testmod(mercurial.ui) | 27 testmod('mercurial.util', testtarget='platform') |
26 | 28 testmod('hgext.convert.cvsps') |
27 import mercurial.url | |
28 doctest.testmod(mercurial.url) | |
29 | |
30 import mercurial.dispatch | |
31 doctest.testmod(mercurial.dispatch) | |
32 | |
33 import mercurial.encoding | |
34 doctest.testmod(mercurial.encoding) | |
35 | |
36 import mercurial.hgweb.hgwebdir_mod | |
37 doctest.testmod(mercurial.hgweb.hgwebdir_mod) | |
38 | |
39 import hgext.convert.cvsps | |
40 doctest.testmod(hgext.convert.cvsps) | |
41 | |
42 import mercurial.revset | |
43 doctest.testmod(mercurial.revset) | |
44 | |
45 import mercurial.minirst | |
46 doctest.testmod(mercurial.minirst) | |
47 | |
48 import mercurial.templatefilters | |
49 doctest.testmod(mercurial.templatefilters) |