[pypy-svn] r15646 - pypy/dist/lib-python/modified-2.4.1/test
pedronis at codespeak.net
pedronis at codespeak.net
Fri Aug 5 00:05:28 CEST 2005
Author: pedronis
Date: Fri Aug 5 00:04:34 2005
New Revision: 15646
Added:
pypy/dist/lib-python/modified-2.4.1/test/list_tests.py
- copied, changed from r15639, pypy/dist/lib-python/2.4.1/test/list_tests.py
pypy/dist/lib-python/modified-2.4.1/test/seq_tests.py
- copied, changed from r15639, pypy/dist/lib-python/2.4.1/test/seq_tests.py
pypy/dist/lib-python/modified-2.4.1/test/test_list.py
- copied unchanged from r15639, pypy/dist/lib-python/2.4.1/test/test_list.py
pypy/dist/lib-python/modified-2.4.1/test/test_tuple.py
- copied unchanged from r15639, pypy/dist/lib-python/2.4.1/test/test_tuple.py
pypy/dist/lib-python/modified-2.4.1/test/test_userlist.py
- copied unchanged from r15639, pypy/dist/lib-python/2.4.1/test/test_userlist.py
Log:
- made tests on __*slice__ conditional
- given that l[Decimal(2)] is not supported the support for .pop seems quite a special case
- do we want to support x is x*1 where x is a tuple?
- the test about the interaction of __getitem__ and __iter__ is impl specific, the effect of overriding __getitem__
are quite unspecified
Copied: pypy/dist/lib-python/modified-2.4.1/test/list_tests.py (from r15639, pypy/dist/lib-python/2.4.1/test/list_tests.py)
==============================================================================
--- pypy/dist/lib-python/2.4.1/test/list_tests.py (original)
+++ pypy/dist/lib-python/modified-2.4.1/test/list_tests.py Fri Aug 5 00:04:34 2005
@@ -178,9 +178,10 @@
a[:] = tuple(range(10))
self.assertEqual(a, self.type2test(range(10)))
- self.assertRaises(TypeError, a.__setslice__, 0, 1, 5)
+ if hasattr(a, '__setslice__'):
+ self.assertRaises(TypeError, a.__setslice__, 0, 1, 5)
- self.assertRaises(TypeError, a.__setslice__)
+ self.assertRaises(TypeError, a.__setslice__)
def test_delslice(self):
a = self.type2test([0, 1])
@@ -281,8 +282,10 @@
self.assertRaises(IndexError, a.pop)
self.assertRaises(TypeError, a.pop, 42, 42)
a = self.type2test([0, 10, 20, 30, 40])
- self.assertEqual(a.pop(Decimal(2)), 20)
- self.assertRaises(IndexError, a.pop, Decimal(25))
+ # xxx Decimal make a bad index as much as float
+ # also l[Decimal(2)] doesn't work, what to make of this?
+ #self.assertEqual(a.pop(Decimal(2)), 20)
+ #self.assertRaises(IndexError, a.pop, Decimal(25))
def test_remove(self):
a = self.type2test([0, 0, 1])
Copied: pypy/dist/lib-python/modified-2.4.1/test/seq_tests.py (from r15639, pypy/dist/lib-python/2.4.1/test/seq_tests.py)
==============================================================================
--- pypy/dist/lib-python/2.4.1/test/seq_tests.py (original)
+++ pypy/dist/lib-python/modified-2.4.1/test/seq_tests.py Fri Aug 5 00:04:34 2005
@@ -106,7 +106,8 @@
self.assertEqual(a[ -pow(2,128L): 3 ], self.type2test([0,1,2]))
self.assertEqual(a[ 3: pow(2,145L) ], self.type2test([3,4]))
- self.assertRaises(TypeError, u.__getslice__)
+ if hasattr(u, '__getslice__'):
+ self.assertRaises(TypeError, u.__getslice__)
def test_contains(self):
u = self.type2test([0, 1, 2])
@@ -174,12 +175,12 @@
u *= 3
self.assertEqual(u, self.type2test([0, 1, 0, 1, 0, 1]))
- def test_getitemoverwriteiter(self):
- # Verify that __getitem__ overrides are not recognized by __iter__
- class T(self.type2test):
- def __getitem__(self, key):
- return str(key) + '!!!'
- self.assertEqual(iter(T((1,2))).next(), 1)
+ #def test_getitemoverwriteiter(self):
+ # # Verify that __getitem__ overrides are not recognized by __iter__
+ # class T(self.type2test):
+ # def __getitem__(self, key):
+ # return str(key) + '!!!'
+ # self.assertEqual(iter(T((1,2))).next(), 1)
def test_repeat(self):
for m in xrange(4):
@@ -187,7 +188,7 @@
for n in xrange(-3, 5):
self.assertEqual(self.type2test(s*n), self.type2test(s)*n)
self.assertEqual(self.type2test(s)*(-4), self.type2test([]))
- self.assertEqual(id(s), id(s*1))
+ #self.assertEqual(id(s), id(s*1))
def test_subscript(self):
a = self.type2test([10, 11])
More information about the Pypy-commit
mailing list