@@ -150,13 +150,13 @@ def test_oldstyle_classes_iterator(self):
150150 An old-style class used as an iterator should be converted
151151 properly. This requires ``futurize`` to do both steps (adding
152152 inheritance from object and adding the newobject import) in the
153- right order.
153+ right order. Any next() method should also be renamed to __next__.
154154 """
155155 before = """
156156 class Upper:
157157 def __init__(self, iterable):
158158 self._iter = iter(iterable)
159- def next(self): # note the Py2 interface
159+ def next(self):
160160 return next(self._iter).upper()
161161 def __iter__(self):
162162 return self
@@ -169,7 +169,7 @@ def __iter__(self):
169169 class Upper(object):
170170 def __init__(self, iterable):
171171 self._iter = iter(iterable)
172- def __next__(self): # note the Py3 interface
172+ def __next__(self):
173173 return next(self._iter).upper()
174174 def __iter__(self):
175175 return self
@@ -183,7 +183,7 @@ def __iter__(self):
183183 class Upper():
184184 def __init__(self, iterable):
185185 self._iter = iter(iterable)
186- def next(self): # note the Py2 interface
186+ def next(self):
187187 return next(self._iter).upper()
188188 def __iter__(self):
189189 return self
@@ -711,7 +711,7 @@ def __iter__(self):
711711 assert next(itr) == 'E'
712712 assert list(itr) == list('LLO')
713713 """
714- self .convert_check (before , after , stages = [1 ])
714+ self .convert_check (before , after , stages = [1 ], run = PY2 )
715715
716716 @unittest .expectedFailure
717717 def test_next_2 (self ):
@@ -748,7 +748,7 @@ def __iter__(self):
748748 assert next(itr) == 'E'
749749 assert list(itr) == list('LLO')
750750 """
751- self .convert_check (before , after , stages = [1 ])
751+ self .convert_check (before , after , stages = [1 ], run = PY2 )
752752
753753 def test_xrange (self ):
754754 """
0 commit comments