[Numpy-svn] r2716 - trunk/numpy/testing

numpy-svn at scipy.org numpy-svn at scipy.org
Fri Jun 30 16:56:29 CDT 2006


Author: stefan
Date: 2006-06-30 16:56:21 -0500 (Fri, 30 Jun 2006)
New Revision: 2716

Modified:
   trunk/numpy/testing/utils.py
Log:
Make 'assert_equal' handle tuples (not only lists). Closes #163.


Modified: trunk/numpy/testing/utils.py
===================================================================
--- trunk/numpy/testing/utils.py	2006-06-30 21:45:16 UTC (rev 2715)
+++ trunk/numpy/testing/utils.py	2006-06-30 21:56:21 UTC (rev 2716)
@@ -129,7 +129,7 @@
             assert actual.has_key(k),`k`
             assert_equal(actual[k], desired[k], 'key=%r\n%s' % (k,err_msg), verbose)
         return
-    if isinstance(desired, list) and isinstance(actual, list):
+    if isinstance(desired, (list,tuple)) and isinstance(actual, (list,tuple)):
         assert_equal(len(actual),len(desired),err_msg,verbose)
         for k in range(len(desired)):
             assert_equal(actual[k], desired[k], 'item=%r\n%s' % (k,err_msg), verbose)



More information about the Numpy-svn mailing list