Author: Brian Kearns <[email protected]>
Branch:
Changeset: r69730:7b7d906a7882
Date: 2014-03-05 13:35 -0500
http://bitbucket.org/pypy/pypy/changeset/7b7d906a7882/
Log: cleanup, enable passing test
diff --git a/pypy/objspace/std/test/test_listobject.py
b/pypy/objspace/std/test/test_listobject.py
--- a/pypy/objspace/std/test/test_listobject.py
+++ b/pypy/objspace/std/test/test_listobject.py
@@ -784,8 +784,6 @@
assert l == [1,2,3,4,5]
def test_iadd_subclass(self):
- #XXX
- skip("Maybe there is something wrong in descroperation?")
class Bar(object):
def __radd__(self, other):
return ('radd', self, other)
@@ -1441,7 +1439,7 @@
l.__setslice__(0,3,l2)
assert l == [0,1,2]
- def test_getitem(self):
+ def test_getitem_range(self):
l = range(5)
raises(IndexError, "l[-6]")
raises(IndexError, "l[5]")
diff --git a/pypy/objspace/std/test/test_rangeobject.py
b/pypy/objspace/std/test/test_rangeobject.py
--- a/pypy/objspace/std/test/test_rangeobject.py
+++ b/pypy/objspace/std/test/test_rangeobject.py
@@ -1,5 +1,6 @@
import py
+
class AppTestRangeListObject(object):
spaceconfig = {"objspace.std.withrangelist": True}
@@ -24,6 +25,14 @@
assert result == [1, 3, 5, 7]
assert self.not_forced(r)
+ def test_getitem_simple(self):
+ r = range(4)
+ assert r[-1] == 3
+ assert r[3] == 3
+ assert r[-4] == 0
+ raises(IndexError, r.__getitem__, -5)
+ raises(IndexError, r.__getitem__, 4)
+
def test_getitem_slice(self):
result = []
r = range(1, 100, 2)
@@ -71,6 +80,7 @@
r = range(10)
r.sort(key=lambda x: -x)
assert r == range(9, -1, -1)
+
def test_pop(self):
# RangeListStrategy
r = range(1, 10)
@@ -109,14 +119,6 @@
assert not self.not_forced(r)
assert r == [1, 2, 3, 4, 5, 6, 7]
- def test_getitem_simple(self):
- r = range(4)
- assert r[-1] == 3
- assert r[3] == 3
- assert r[-4] == 0
- raises(IndexError, r.__getitem__, -5)
- raises(IndexError, r.__getitem__, 4)
-
def test_reduce(self):
it = iter(range(10))
assert it.next() == 0
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit