diff test.py @ 160:68160fd149fe

Simple script to doctest all modules beneath ift6266. This ecxcludes scripts since most of the files launch computations when imported and some even start a lot of jobs on the cluster (This happened to me when testing).
author Arnaud Bergeron <abergeron@gmail.com>
date Thu, 25 Feb 2010 17:27:49 -0500
parents
children c1d5474c3386
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test.py	Thu Feb 25 17:27:49 2010 -0500
@@ -0,0 +1,15 @@
+import doctest, sys, pkgutil
+
+def runTests(options = doctest.ELLIPSIS or doctest.DONT_ACCEPT_TRUE_FOR_1):
+    import ift6266
+    predefs = ift6266.__dict__
+    for (_, name, ispkg) in pkgutil.walk_packages(ift6266.__path__, ift6266.__name__+'.'):
+        if not ispkg:
+            if name.startswith('ift6266.scripts'):
+                continue
+            print "Testing:", name
+            __import__(name)
+            doctest.testmod(sys.modules[name], extraglobs=predefs, optionflags=options)
+
+if __name__ == '__main__':
+    runTests()