[Scipy-svn] r6419 - trunk/scipy/io/matlab/tests

scipy-svn at scipy.org scipy-svn at scipy.org
Sat May 29 00:10:13 EDT 2010


Author: matthew.brett at gmail.com
Date: 2010-05-28 23:10:13 -0500 (Fri, 28 May 2010)
New Revision: 6419

Modified:
   trunk/scipy/io/matlab/tests/test_mio.py
   trunk/scipy/io/matlab/tests/test_mio_funcs.py
Log:
FIX - added b flags to matlab file open to placate windows

Modified: trunk/scipy/io/matlab/tests/test_mio.py
===================================================================
--- trunk/scipy/io/matlab/tests/test_mio.py	2010-05-28 03:40:26 UTC (rev 6418)
+++ trunk/scipy/io/matlab/tests/test_mio.py	2010-05-29 04:10:13 UTC (rev 6419)
@@ -676,7 +676,7 @@
 def test_empty_string():
     # make sure reading empty string does not raise error
     estring_fname = pjoin(test_data_path, 'single_empty_string.mat')
-    rdr = MatFile5Reader_future(file(estring_fname))
+    rdr = MatFile5Reader_future(file(estring_fname, 'rb'))
     d = rdr.get_variables()
     yield assert_array_equal, d['a'], np.array([], dtype='U1')
     # empty string round trip.  Matlab cannot distiguish
@@ -714,7 +714,7 @@
 
 def test_func_read():
     func_eg = pjoin(test_data_path, 'testfunc_7.4_GLNX86.mat')
-    rdr = MatFile5Reader_future(file(func_eg))
+    rdr = MatFile5Reader_future(file(func_eg, 'rb'))
     d = rdr.get_variables()
     yield assert_true, isinstance(d['testfunc'], MatlabFunction)
     stream = StringIO()
@@ -724,10 +724,10 @@
 
 def test_mat_dtype():
     double_eg = pjoin(test_data_path, 'testmatrix_6.1_SOL2.mat')
-    rdr = MatFile5Reader_future(file(double_eg), mat_dtype=False)
+    rdr = MatFile5Reader_future(file(double_eg, 'rb'), mat_dtype=False)
     d = rdr.get_variables()
     yield assert_equal, d['testmatrix'].dtype.kind, 'u'
-    rdr = MatFile5Reader_future(file(double_eg), mat_dtype=True)
+    rdr = MatFile5Reader_future(file(double_eg, 'rb'), mat_dtype=True)
     d = rdr.get_variables()
     yield assert_equal, d['testmatrix'].dtype.kind, 'f'
 

Modified: trunk/scipy/io/matlab/tests/test_mio_funcs.py
===================================================================
--- trunk/scipy/io/matlab/tests/test_mio_funcs.py	2010-05-28 03:40:26 UTC (rev 6418)
+++ trunk/scipy/io/matlab/tests/test_mio_funcs.py	2010-05-29 04:10:13 UTC (rev 6419)
@@ -39,7 +39,7 @@
     return mdict
 
 def read_workspace_vars(fname):
-    rdr = MatFile5Reader(file(fname),
+    rdr = MatFile5Reader(file(fname, 'rb'),
                           struct_as_record=True)
     vars = rdr.get_variables()
     fws = vars['__function_workspace__']
@@ -53,7 +53,7 @@
     return read_minimat_vars(rdr)
 
 
-if __name__ == '__main__':
+def test_jottings():
     # example
     fname = pjoin(test_data_path, 'parabola.mat')
     ws_vars = read_workspace_vars(fname)




More information about the Scipy-svn mailing list