diff transformations/testmod.py @ 296:089f236759d9

Fix testmod so that modules with no parameters are accepted.
author Arnaud Bergeron <abergeron@gmail.com>
date Wed, 10 Feb 2010 10:58:44 -0500
parents 368f1907ad5a
children 6f606b359df3
line wrap: on
line diff
--- a/transformations/testmod.py	Wed Feb 10 00:38:54 2010 -0500
+++ b/transformations/testmod.py	Wed Feb 10 10:58:44 2010 -0500
@@ -56,9 +56,6 @@
 if type(names) is not list:
     error("Must return a list")
 
-if len(names) == 0: 
-    error("Must return at least one element")
-
 if not all(type(e) is str for e in names):
     warn("The elements of the list should be strings")
 
@@ -77,7 +74,7 @@
     error("the returned parameter list must have the same length as the number of parameters")
 
 params2 = mod.regenerate_parameters(0.2)
-if params == params2:
+if len(names) != 0 && params == params2:
     error("the complexity parameter determines the distribution of the parameters, not their value")
 
 mod.regenerate_parameters(0.0)