summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-12-27 17:05:29 +0000
committerBenjamin Peterson <benjamin@python.org>2008-12-27 17:05:29 +0000
commit828a7066f12e758c30829363c8ec9018c6c2a94f (patch)
tree96fb5d0d088d0313a4f31a7a7da84c69cfa34474 /Lib/test
parentba48608711a5139006227c0a4c800ce352b2b77b (diff)
downloadcpython-git-828a7066f12e758c30829363c8ec9018c6c2a94f.tar.gz
Merged revisions 67898,67904-67907,67912,67918,67920-67921,67923-67924,67927,67930,67932,67943 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r67898 | benjamin.peterson | 2008-12-21 15:00:53 -0600 (Sun, 21 Dec 2008) | 1 line compute DISTVERSION with patchlevel.py ........ r67904 | benjamin.peterson | 2008-12-22 14:44:58 -0600 (Mon, 22 Dec 2008) | 1 line less attitude ........ r67905 | benjamin.peterson | 2008-12-22 14:51:15 -0600 (Mon, 22 Dec 2008) | 1 line fix #4720: the format to PyArg_ParseTupleAndKeywords can now start with '|' ........ r67906 | benjamin.peterson | 2008-12-22 14:52:53 -0600 (Mon, 22 Dec 2008) | 1 line add NEWS note ........ r67907 | benjamin.peterson | 2008-12-22 16:12:19 -0600 (Mon, 22 Dec 2008) | 1 line silence compiler warning ........ r67912 | georg.brandl | 2008-12-23 06:37:21 -0600 (Tue, 23 Dec 2008) | 2 lines Fix missing "svn" command. ........ r67918 | georg.brandl | 2008-12-23 09:44:25 -0600 (Tue, 23 Dec 2008) | 2 lines Markup fix. ........ r67920 | benjamin.peterson | 2008-12-23 14:09:28 -0600 (Tue, 23 Dec 2008) | 1 line use a global variable, so the compiler doesn't optimize the assignment out ........ r67921 | benjamin.peterson | 2008-12-23 14:12:33 -0600 (Tue, 23 Dec 2008) | 1 line make global static ........ r67923 | benjamin.peterson | 2008-12-24 09:10:27 -0600 (Wed, 24 Dec 2008) | 1 line #4736 BufferRWPair.closed shouldn't try to call another property as a function ........ r67924 | benjamin.peterson | 2008-12-24 10:10:05 -0600 (Wed, 24 Dec 2008) | 1 line pretend exceptions don't exist a while longer ........ r67927 | benjamin.peterson | 2008-12-26 17:26:30 -0600 (Fri, 26 Dec 2008) | 1 line python version is included in file name now ........ r67930 | hirokazu.yamamoto | 2008-12-26 22:19:48 -0600 (Fri, 26 Dec 2008) | 2 lines Issue #4740: Use HIGHEST_PROTOCOL in pickle test. (There is no behavior difference in 2.x because HIGHEST_PROTOCOL == 2) ........ r67932 | alexandre.vassalotti | 2008-12-27 00:36:10 -0600 (Sat, 27 Dec 2008) | 5 lines Remove unnecessary casts related to unicode_decode_call_errorhandler. Make the _PyUnicode_Resize macro a static function. These changes are needed to avoid breaking strict aliasing rules. ........ r67943 | alexandre.vassalotti | 2008-12-27 04:02:59 -0600 (Sat, 27 Dec 2008) | 2 lines Fix bogus unicode tests in pickletester. ........
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/pickletester.py4
-rwxr-xr-xLib/test/test_array.py6
-rw-r--r--Lib/test/test_deque.py4
-rw-r--r--Lib/test/test_io.py3
-rw-r--r--Lib/test/test_set.py2
5 files changed, 10 insertions, 9 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index bf25245bd1..bd0a3a4813 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -480,8 +480,8 @@ class AbstractPickleTests(unittest.TestCase):
if have_unicode:
def test_unicode(self):
- endcases = [u'', u'<\\u>', u'<\\\\u1234>', u'<\n>',
- u'<\\>', u'<\\\\U00012345>']
+ endcases = [u'', u'<\\u>', u'<\\\u1234>', u'<\n>',
+ u'<\\>', u'<\\\U00012345>']
for proto in protocols:
for u in endcases:
p = self.dumps(u, proto)
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 2efbc7d677..2c4c2fdc9f 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -7,7 +7,7 @@ import unittest
from test import test_support
from weakref import proxy
import array, cStringIO
-from cPickle import loads, dumps
+from cPickle import loads, dumps, HIGHEST_PROTOCOL
class ArraySubclass(array.array):
pass
@@ -97,7 +97,7 @@ class BaseTest(unittest.TestCase):
self.assertEqual(a, b)
def test_pickle(self):
- for protocol in (0, 1, 2):
+ for protocol in range(HIGHEST_PROTOCOL + 1):
a = array.array(self.typecode, self.example)
b = loads(dumps(a, protocol))
self.assertNotEqual(id(a), id(b))
@@ -112,7 +112,7 @@ class BaseTest(unittest.TestCase):
self.assertEqual(type(a), type(b))
def test_pickle_for_empty_array(self):
- for protocol in (0, 1, 2):
+ for protocol in range(HIGHEST_PROTOCOL + 1):
a = array.array(self.typecode)
b = loads(dumps(a, protocol))
self.assertNotEqual(id(a), id(b))
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py
index 0b751d865c..0f0d09847e 100644
--- a/Lib/test/test_deque.py
+++ b/Lib/test/test_deque.py
@@ -373,7 +373,7 @@ class TestBasic(unittest.TestCase):
def test_pickle(self):
d = deque(xrange(200))
- for i in (0, 1, 2):
+ for i in range(pickle.HIGHEST_PROTOCOL + 1):
s = pickle.dumps(d, i)
e = pickle.loads(s)
self.assertNotEqual(id(d), id(e))
@@ -382,7 +382,7 @@ class TestBasic(unittest.TestCase):
## def test_pickle_recursive(self):
## d = deque('abc')
## d.append(d)
-## for i in (0, 1, 2):
+## for i in range(pickle.HIGHEST_PROTOCOL + 1):
## e = pickle.loads(pickle.dumps(d, i))
## self.assertNotEqual(id(d), id(e))
## self.assertEqual(id(e), id(e[-1]))
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 8a7da60947..967018ea45 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -554,8 +554,9 @@ class BufferedRWPairTest(unittest.TestCase):
r = MockRawIO(())
w = MockRawIO()
pair = io.BufferedRWPair(r, w)
+ self.assertFalse(pair.closed)
- # XXX need implementation
+ # XXX More Tests
class BufferedRandomTest(unittest.TestCase):
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 499406f3c2..d38a675907 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -221,7 +221,7 @@ class TestJointOps(unittest.TestCase):
self.failIf(set('cbs').issuperset('a'))
def test_pickling(self):
- for i in (0, 1, 2):
+ for i in range(pickle.HIGHEST_PROTOCOL + 1):
p = pickle.dumps(self.s, i)
dup = pickle.loads(p)
self.assertEqual(self.s, dup, "%s != %s" % (self.s, dup))