summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_io.py
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-03-09 09:40:53 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-03-09 09:40:53 +0000
commitd4722fad0baee09e07f8f752d1be83146a6da4df (patch)
tree8e2235021b9ebcee4b8a870fe1eb02b299e88d33 /numpy/lib/tests/test_io.py
parent03c47e45987edf002f4094d3d39f4a1e3eff01f0 (diff)
downloadnumpy-d4722fad0baee09e07f8f752d1be83146a6da4df.tar.gz
Do not hardcode string for savetxt testing, as the exact representation depends on the platform.
Diffstat (limited to 'numpy/lib/tests/test_io.py')
-rw-r--r--numpy/lib/tests/test_io.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index 076f20e5e..a7796d022 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -122,15 +122,16 @@ class TestSavezLoad(RoundtripTest, TestCase):
class TestSaveTxt(TestCase):
- @np.testing.dec.knownfailureif(sys.platform=='win32', "Fail on Win32")
+ #@np.testing.dec.knownfailureif(sys.platform=='win32', "Fail on Win32")
def test_array(self):
a =np.array([[1, 2], [3, 4]], float)
+ fmt = "%.18e"
c = StringIO.StringIO()
- np.savetxt(c, a)
+ np.savetxt(c, a, fmt=fmt)
c.seek(0)
- assert(c.readlines() ==
- ['1.000000000000000000e+00 2.000000000000000000e+00\n',
- '3.000000000000000000e+00 4.000000000000000000e+00\n'])
+ assert_equal(c.readlines(),
+ [(fmt + ' ' + fmt + '\n') % (1, 2),
+ (fmt + ' ' + fmt + '\n') % (3, 4)])
a =np.array([[1, 2], [3, 4]], int)
c = StringIO.StringIO()