annotate test.py @ 184:81f8466dc121

Transient exception handling in captchas (ie. lorsque le NFS est temporairement inaccessible)
author boulanni <nicolas_boulanger@hotmail.com>
date Sat, 27 Feb 2010 19:26:26 -0500
parents ff26436d42d6
children 92ee9896020d 92c9a6c48ce9
rev   line source
160
68160fd149fe Simple script to doctest all modules beneath ift6266.
Arnaud Bergeron <abergeron@gmail.com>
parents:
diff changeset
1 import doctest, sys, pkgutil
68160fd149fe Simple script to doctest all modules beneath ift6266.
Arnaud Bergeron <abergeron@gmail.com>
parents:
diff changeset
2
68160fd149fe Simple script to doctest all modules beneath ift6266.
Arnaud Bergeron <abergeron@gmail.com>
parents:
diff changeset
3 def runTests(options = doctest.ELLIPSIS or doctest.DONT_ACCEPT_TRUE_FOR_1):
68160fd149fe Simple script to doctest all modules beneath ift6266.
Arnaud Bergeron <abergeron@gmail.com>
parents:
diff changeset
4 import ift6266
68160fd149fe Simple script to doctest all modules beneath ift6266.
Arnaud Bergeron <abergeron@gmail.com>
parents:
diff changeset
5 predefs = ift6266.__dict__
68160fd149fe Simple script to doctest all modules beneath ift6266.
Arnaud Bergeron <abergeron@gmail.com>
parents:
diff changeset
6 for (_, name, ispkg) in pkgutil.walk_packages(ift6266.__path__, ift6266.__name__+'.'):
68160fd149fe Simple script to doctest all modules beneath ift6266.
Arnaud Bergeron <abergeron@gmail.com>
parents:
diff changeset
7 if not ispkg:
174
ff26436d42d6 Make data_generation.transformations importable and fixup test.py to not try some of the modules.
Arnaud Bergeron <abergeron@gmail.com>
parents: 162
diff changeset
8 if name.startswith('ift6266.scripts.') or \
ff26436d42d6 Make data_generation.transformations importable and fixup test.py to not try some of the modules.
Arnaud Bergeron <abergeron@gmail.com>
parents: 162
diff changeset
9 name.startswith('ift6266.data_generation.transformations.pycaptcha.') or \
ff26436d42d6 Make data_generation.transformations importable and fixup test.py to not try some of the modules.
Arnaud Bergeron <abergeron@gmail.com>
parents: 162
diff changeset
10 name in ['ift6266.test',
ff26436d42d6 Make data_generation.transformations importable and fixup test.py to not try some of the modules.
Arnaud Bergeron <abergeron@gmail.com>
parents: 162
diff changeset
11 'ift6266.data_generation.transformations.testmod',
ff26436d42d6 Make data_generation.transformations importable and fixup test.py to not try some of the modules.
Arnaud Bergeron <abergeron@gmail.com>
parents: 162
diff changeset
12 'ift6266.data_generation.transformations.gimp_script']:
160
68160fd149fe Simple script to doctest all modules beneath ift6266.
Arnaud Bergeron <abergeron@gmail.com>
parents:
diff changeset
13 continue
68160fd149fe Simple script to doctest all modules beneath ift6266.
Arnaud Bergeron <abergeron@gmail.com>
parents:
diff changeset
14 print "Testing:", name
68160fd149fe Simple script to doctest all modules beneath ift6266.
Arnaud Bergeron <abergeron@gmail.com>
parents:
diff changeset
15 __import__(name)
68160fd149fe Simple script to doctest all modules beneath ift6266.
Arnaud Bergeron <abergeron@gmail.com>
parents:
diff changeset
16 doctest.testmod(sys.modules[name], extraglobs=predefs, optionflags=options)
68160fd149fe Simple script to doctest all modules beneath ift6266.
Arnaud Bergeron <abergeron@gmail.com>
parents:
diff changeset
17
68160fd149fe Simple script to doctest all modules beneath ift6266.
Arnaud Bergeron <abergeron@gmail.com>
parents:
diff changeset
18 if __name__ == '__main__':
68160fd149fe Simple script to doctest all modules beneath ift6266.
Arnaud Bergeron <abergeron@gmail.com>
parents:
diff changeset
19 runTests()