[Scipy-svn] r3497 - trunk/scipy/stats/tests

scipy-svn@scip... scipy-svn@scip...
Sat Nov 3 23:35:13 CDT 2007


Author: cookedm
Date: 2007-11-03 23:35:10 -0500 (Sat, 03 Nov 2007)
New Revision: 3497

Modified:
   trunk/scipy/stats/tests/test_distributions.py
Log:
scipy/stats/tests/test_distributions.py: Use %(var)s instead of %s when creating string for kstests on distributions.


Modified: trunk/scipy/stats/tests/test_distributions.py
===================================================================
--- trunk/scipy/stats/tests/test_distributions.py	2007-11-04 04:33:48 UTC (rev 3496)
+++ trunk/scipy/stats/tests/test_distributions.py	2007-11-04 04:35:10 UTC (rev 3497)
@@ -59,15 +59,15 @@
     else:
         args = str(tuple(1.0+rand(nargs)))
     exstr = r"""
-class Test%s(NumpyTestCase):
+class Test%(dist)s(NumpyTestCase):
     def check_cdf(self):
-        D,pval = stats.kstest('%s','',args=%s,N=30)
-        if (pval < %f):
-            D,pval = stats.kstest('%s','',args=%s,N=30)
-            #if (pval < %f):
-            #    D,pval = stats.kstest('%s','',args=%s,N=30)
-        assert (pval > %f), "D = " + str(D) + "; pval = " + str(pval) + "; alpha = " + str(alpha) + "\nargs = " + str(%s)
-""" % (dist,dist,args,alpha,dist,args,alpha,dist,args,alpha,args)
+        D,pval = stats.kstest('%(dist)s','',args=%(args)s,N=30)
+        if (pval < %(alpha)f):
+            D,pval = stats.kstest('%(dist)s','',args=%(args)s,N=30)
+            #if (pval < %(alpha)f):
+            #    D,pval = stats.kstest('%(dist)s','',args=%(args)s,N=30)
+        assert (pval > %(alpha)f), "D = " + str(D) + "; pval = " + str(pval) + "; alpha = " + str(alpha) + "\nargs = " + str(%(args)s)
+""" % {'dist' : dist, 'args' : args, 'alpha' : alpha}
     exec exstr
 
 



More information about the Scipy-svn mailing list