Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_array.py @ 41859:e4e8b12770e4
Fixed array.fromfile(); removed references to PyFileObject in array.tofile().
Fixed test_array by removing tests that these two functions don't work
with cStringIO objects (which makes no sense).
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 24 May 2007 19:02:32 +0000 |
| parents | ae691227fd34 |
| children | 229c28cb9afb |
line wrap: on
line diff
--- a/Lib/test/test_array.py Thu May 24 18:05:27 2007 +0000 +++ b/Lib/test/test_array.py Thu May 24 19:02:32 2007 +0000 @@ -6,7 +6,7 @@ import unittest from test import test_support from weakref import proxy -import array, cStringIO, math +import array, io, math from pickle import loads, dumps class ArraySubclass(array.array): @@ -162,7 +162,6 @@ def test_tofromfile(self): a = array.array(self.typecode, 2*self.example) self.assertRaises(TypeError, a.tofile) - ##self.assertRaises(TypeError, a.tofile, cStringIO.StringIO()) f = open(test_support.TESTFN, 'wb') try: a.tofile(f) @@ -170,11 +169,6 @@ b = array.array(self.typecode) f = open(test_support.TESTFN, 'rb') self.assertRaises(TypeError, b.fromfile) - self.assertRaises( - TypeError, - b.fromfile, - cStringIO.StringIO(), len(self.example) - ) b.fromfile(f, len(self.example)) self.assertEqual(b, array.array(self.typecode, self.example)) self.assertNotEqual(a, b)
