Philip Jenvey avatar Philip Jenvey committed 018c042

2to3

Comments (0)

Files changed (1)

pypy/module/test_lib_pypy/test_collections.py

     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
 
         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
         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
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.