Commits

Philip Jenvey committed e34541f

adapt to py3 and kill the old range list tests again

Comments (0)

Files changed (1)

pypy/objspace/std/test/test_listobject.py

         assert list(L([5, 6])) == ["ok"]
         assert list(L([5.2, 6.3])) == ["ok"]
         #
-        class S(str):
+        class S(bytes):
             def __iter__(self):
                 yield "ok"
-        assert list(S("don't see me")) == ["ok"]
+        assert list(S(b"don't see me")) == ["ok"]
         #
-        class U(unicode):
+        class U(str):
             def __iter__(self):
                 yield "ok"
-        assert list(U(u"don't see me")) == ["ok"]
+        assert list(U("don't see me")) == ["ok"]
 
     def test_extend_from_nonempty_list_with_subclasses(self):
         l = ["hi!"]
         l.extend(L([5, 6]))
         l.extend(L([5.2, 6.3]))
         #
-        class S(str):
+        class S(bytes):
             def __iter__(self):
                 yield "okS"
-        l.extend(S("don't see me"))
+        l.extend(S(b"don't see me"))
         #
-        class U(unicode):
+        class U(str):
             def __iter__(self):
                 yield "okU"
-        l.extend(U(u"don't see me"))
+        l.extend(U("don't see me"))
         #
         assert l == ["hi!", "okT", "okL", "okL", "okS", "okU"]
 
         assert item11 in l[::11]
 
 
-class AppTestForRangeLists(AppTestW_ListObject):
-    spaceconfig = {"objspace.std.withrangelist": True}
-
-    def test_range_simple_backwards(self):
-        x = range(5,1)
-        assert x == []
-
-    def test_range_big_start(self):
-        x = range(1,10)
-        x[22:0:-1] == range(1,10)
-
-    def test_range_list_invalid_slice(self):
-        x = [1,2,3,4]
-        assert x[10:0] == []
-        assert x[10:0:None] == []
-
-        x = range(1,5)
-        assert x[10:0] == []
-        assert x[10:0:None] == []
-
-        assert x[0:22] == [1,2,3,4]
-        assert x[-1:10] == [4]
-
-        assert x[0:22:None] == [1,2,3,4]
-        assert x[-1:10:None] == [4]
-
-    def test_range_backwards(self):
-        x = range(1,10)
-        assert x[22:-10] == []
-        assert x[22:-10:-1] == [9,8,7,6,5,4,3,2,1]
-        assert x[10:3:-1] == [9,8,7,6,5]
-        assert x[10:3:-2] == [9,7,5]
-        assert x[1:5:-1] == []
-
-    def test_sort_range(self):
-        l = range(3,10,3)
-        l.sort()
-        assert l == [3, 6, 9]
-        l.sort(reverse = True)
-        assert l == [9, 6, 3]
-        l.sort(reverse = True)
-        assert l == [9, 6, 3]
-        l.sort()
-        assert l == [3, 6, 9]
-
-    def test_slice(self):
-        l = []
-        l2 = range(3)
-        l.__setslice__(0,3,l2)
-        assert l == [0,1,2]
-
-    def test_getitem(self):
-        l = range(5)
-        raises(IndexError, "l[-10]")
-
-    def test_append(self):
-        l = range(5)
-        l.append(26)
-        assert l == [0,1,2,3,4,26]
-
-        l = range(5)
-        l.append("a")
-        assert l == [0,1,2,3,4,"a"]
-
-        l = range(5)
-        l.append(5)
-        assert l == [0,1,2,3,4,5]
-
-    def test_pop(self):
-        l = range(3)
-        assert l.pop(0) == 0
-
-    def test_setitem(self):
-        l = range(3)
-        l[0] = 1
-        assert l == [1,1,2]
-
-    def test_inset(self):
-        l = range(3)
-        l.insert(1,5)
-        assert l == [0,5,1,2]
-
-    def test_reverse(self):
-        l = range(3)
-        l.reverse()
-        assert l == [2,1,0]
-
-
 class AppTestWithoutStrategies(object):
     spaceconfig = {"objspace.std.withliststrategies": False}
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.