summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-12-05 09:08:28 +0000
committerGeorg Brandl <georg@python.org>2008-12-05 09:08:28 +0000
commitfa71a907031b9342c47eef17a840d0488063801c (patch)
tree808092f73be6610d1848e10623d12608093788f3 /Lib/test
parent5667280a07cc12691709e2b5ffa9ac7e3a0172ee (diff)
downloadcpython-git-fa71a907031b9342c47eef17a840d0488063801c.tar.gz
Merged revisions 67326,67498,67531-67532,67538,67553-67554,67556-67557 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r67326 | benjamin.peterson | 2008-11-22 02:59:15 +0100 (Sat, 22 Nov 2008) | 1 line backport r67325: make FileIO.mode always contain 'b' ........ r67498 | raymond.hettinger | 2008-12-03 16:42:10 +0100 (Wed, 03 Dec 2008) | 1 line Backport r67478 ........ r67531 | georg.brandl | 2008-12-04 19:54:05 +0100 (Thu, 04 Dec 2008) | 2 lines Add reference to enumerate() to indices example. ........ r67532 | georg.brandl | 2008-12-04 19:59:16 +0100 (Thu, 04 Dec 2008) | 2 lines Add another heapq example. ........ r67538 | georg.brandl | 2008-12-04 22:28:16 +0100 (Thu, 04 Dec 2008) | 2 lines Clarification to avoid confusing output with file descriptors. ........ r67553 | georg.brandl | 2008-12-05 08:49:49 +0100 (Fri, 05 Dec 2008) | 2 lines #4408: document regex.groups. ........ r67554 | georg.brandl | 2008-12-05 08:52:26 +0100 (Fri, 05 Dec 2008) | 2 lines #4409: fix asterisks looking like footnotes. ........ r67556 | georg.brandl | 2008-12-05 09:02:17 +0100 (Fri, 05 Dec 2008) | 2 lines #4441: improve doc for os.open() flags. ........ r67557 | georg.brandl | 2008-12-05 09:06:57 +0100 (Fri, 05 Dec 2008) | 2 lines Add an index entry for "subclassing immutable types". ........
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/list_tests.py2
-rw-r--r--Lib/test/test_fileio.py4
-rw-r--r--Lib/test/test_io.py14
3 files changed, 11 insertions, 9 deletions
diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py
index b3f24d30a9..c9aa3160a9 100644
--- a/Lib/test/list_tests.py
+++ b/Lib/test/list_tests.py
@@ -84,6 +84,8 @@ class CommonTest(seq_tests.CommonTest):
self.assertRaises(StopIteration, r.next)
self.assertEqual(list(reversed(self.type2test())),
self.type2test())
+ # Bug 3689: make sure list-reversed-iterator doesn't have __len__
+ self.assertRaises(TypeError, len, reversed([1,2,3]))
def test_setitem(self):
a = self.type2test([0, 1])
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py
index cbc7165707..c9787795e3 100644
--- a/Lib/test/test_fileio.py
+++ b/Lib/test/test_fileio.py
@@ -50,7 +50,7 @@ class AutoFileTests(unittest.TestCase):
# verify expected attributes exist
f = self.f
- self.assertEquals(f.mode, "w")
+ self.assertEquals(f.mode, "wb")
self.assertEquals(f.closed, False)
# verify the attributes are readonly
@@ -160,7 +160,7 @@ class OtherFileTests(unittest.TestCase):
def testModeStrings(self):
# check invalid mode strings
- for mode in ("", "aU", "wU+", "rb", "rt"):
+ for mode in ("", "aU", "wU+", "rw", "rt"):
try:
f = _fileio._FileIO(TESTFN, mode)
except ValueError:
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index c9bd38ddff..eb41d1ffa7 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -1266,7 +1266,7 @@ class MiscIOTest(unittest.TestCase):
def test_attributes(self):
f = io.open(test_support.TESTFN, "wb", buffering=0)
- self.assertEquals(f.mode, "w")
+ self.assertEquals(f.mode, "wb")
f.close()
f = io.open(test_support.TESTFN, "U")
@@ -1274,18 +1274,18 @@ class MiscIOTest(unittest.TestCase):
self.assertEquals(f.buffer.name, test_support.TESTFN)
self.assertEquals(f.buffer.raw.name, test_support.TESTFN)
self.assertEquals(f.mode, "U")
- self.assertEquals(f.buffer.mode, "r")
- self.assertEquals(f.buffer.raw.mode, "r")
+ self.assertEquals(f.buffer.mode, "rb")
+ self.assertEquals(f.buffer.raw.mode, "rb")
f.close()
f = io.open(test_support.TESTFN, "w+")
self.assertEquals(f.mode, "w+")
- self.assertEquals(f.buffer.mode, "r+") # Does it really matter?
- self.assertEquals(f.buffer.raw.mode, "r+")
+ self.assertEquals(f.buffer.mode, "rb+") # Does it really matter?
+ self.assertEquals(f.buffer.raw.mode, "rb+")
g = io.open(f.fileno(), "wb", closefd=False)
- self.assertEquals(g.mode, "w")
- self.assertEquals(g.raw.mode, "w")
+ self.assertEquals(g.mode, "wb")
+ self.assertEquals(g.raw.mode, "wb")
self.assertEquals(g.name, f.fileno())
self.assertEquals(g.raw.name, f.fileno())
f.close()