[pypy-commit] pypy py3k: 2to3

pjenvey noreply at buildbot.pypy.org
Sat Jul 20 03:22:08 CEST 2013


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r65498:018c042a46f0
Date: 2013-07-19 18:20 -0700
http://bitbucket.org/pypy/pypy/changeset/018c042a46f0/

Log:	2to3

diff --git a/pypy/module/test_lib_pypy/test_collections.py b/pypy/module/test_lib_pypy/test_collections.py
--- a/pypy/module/test_lib_pypy/test_collections.py
+++ b/pypy/module/test_lib_pypy/test_collections.py
@@ -28,17 +28,17 @@
     def test_deque_iter(self):
         it = iter(self.d)
         raises(TypeError, len, it)
-        assert it.next() == 0
+        assert next(it) == 0
         self.d.pop()
-        raises(RuntimeError, it.next)
+        raises(RuntimeError, next, it)
 
     def test_deque_reversed(self):
         it = reversed(self.d)
         raises(TypeError, len, it)
-        assert it.next() == self.n-1
-        assert it.next() == self.n-2
+        assert next(it) == self.n-1
+        assert next(it) == self.n-2
         self.d.pop()
-        raises(RuntimeError, it.next)
+        raises(RuntimeError, next, it)
 
     def test_deque_remove(self):
         d = self.d
@@ -124,7 +124,7 @@
 
         d = collections.deque(range(100))
         d.reverse()
-        assert list(d) == range(99, -1, -1)
+        assert list(d) == list(range(99, -1, -1))
 
     def test_subclass_with_kwargs(self):
         collections = self.collections
@@ -194,7 +194,7 @@
         d2 = collections.defaultdict(int)
         assert d2.default_factory == int
         d2[12] = 42
-        assert repr(d2) == "defaultdict(<type 'int'>, {12: 42})"
+        assert repr(d2) == "defaultdict(<class 'int'>, {12: 42})"
         def foo(): return 43
         d3 = collections.defaultdict(foo)
         assert d3.default_factory is foo


More information about the pypy-commit mailing list