changeset 71:22823acc1712

Fix testmod to accept modules with no params.
author Arnaud Bergeron <abergeron@gmail.com>
date Wed, 10 Feb 2010 11:23:30 -0500
parents be24db3a4d6e
children af2f9252dd14
files transformations/testmod.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/transformations/testmod.py	Wed Feb 10 00:38:54 2010 -0500
+++ b/transformations/testmod.py	Wed Feb 10 11:23:30 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 and params == params2:
     error("the complexity parameter determines the distribution of the parameters, not their value")
 
 mod.regenerate_parameters(0.0)