From 13918161ec7dfe6f7ce1fb871cf978a564d80df3 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Thu, 13 May 2010 12:47:04 +0000 Subject: BUG/3K: lib: make savetxt work with filenames --- numpy/lib/tests/test_io.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'numpy/lib/tests/test_io.py') diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index a50c6f267..73d3c3599 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -225,6 +225,17 @@ class TestSaveTxt(TestCase): lines = c.readlines() assert_equal(lines, asbytes_nested(['01 : 2.0\n', '03 : 4.0\n'])) + def test_file_roundtrip(self): + f, name = mkstemp() + os.close(f) + try: + a = np.array([(1, 2), (3, 4)]) + np.savetxt(name, a) + b = np.loadtxt(name) + assert_array_equal(a, b) + finally: + os.unlink(name) + class TestLoadTxt(TestCase): def test_record(self): -- cgit v1.2.1