Mercurial > ift6266
comparison test.py @ 161:c1d5474c3386
Make test not test itself.
author | Arnaud Bergeron <abergeron@gmail.com> |
---|---|
date | Thu, 25 Feb 2010 18:11:25 -0500 |
parents | 68160fd149fe |
children | 050c7ff6b449 |
comparison
equal
deleted
inserted
replaced
160:68160fd149fe | 161:c1d5474c3386 |
---|---|
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'): | 8 if name.startswith('ift6266.scripts') or |
9 name in ['ift6266.test']: | |
9 continue | 10 continue |
10 print "Testing:", name | 11 print "Testing:", name |
11 __import__(name) | 12 __import__(name) |
12 doctest.testmod(sys.modules[name], extraglobs=predefs, optionflags=options) | 13 doctest.testmod(sys.modules[name], extraglobs=predefs, optionflags=options) |
13 | 14 |