comparison test.py @ 174:ff26436d42d6

Make data_generation.transformations importable and fixup test.py to not try some of the modules.
author Arnaud Bergeron <abergeron@gmail.com>
date Sat, 27 Feb 2010 12:18:26 -0500
parents 050c7ff6b449
children 92ee9896020d 92c9a6c48ce9
comparison
equal deleted inserted replaced
173:954185d6002a 174:ff26436d42d6
3 def runTests(options = doctest.ELLIPSIS or doctest.DONT_ACCEPT_TRUE_FOR_1): 3 def runTests(options = doctest.ELLIPSIS or doctest.DONT_ACCEPT_TRUE_FOR_1):
4 import ift6266 4 import ift6266
5 predefs = ift6266.__dict__ 5 predefs = ift6266.__dict__
6 for (_, name, ispkg) in pkgutil.walk_packages(ift6266.__path__, ift6266.__name__+'.'): 6 for (_, name, ispkg) in pkgutil.walk_packages(ift6266.__path__, ift6266.__name__+'.'):
7 if not ispkg: 7 if not ispkg:
8 if name.startswith('ift6266.scripts') or \ 8 if name.startswith('ift6266.scripts.') or \
9 name in ['ift6266.test']: 9 name.startswith('ift6266.data_generation.transformations.pycaptcha.') or \
10 name in ['ift6266.test',
11 'ift6266.data_generation.transformations.testmod',
12 'ift6266.data_generation.transformations.gimp_script']:
10 continue 13 continue
11 print "Testing:", name 14 print "Testing:", name
12 __import__(name) 15 __import__(name)
13 doctest.testmod(sys.modules[name], extraglobs=predefs, optionflags=options) 16 doctest.testmod(sys.modules[name], extraglobs=predefs, optionflags=options)
14 17