Skip to content

Commit 3c5d7ba

Browse files
committed
Merge pull request pallets#743 from ThomasWaldmann/sprint-branch
fix iterator in testsuite helpers
2 parents ffbcad1 + af5576a commit 3c5d7ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

flask/testsuite/helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from logging import StreamHandler
1616
from flask.testsuite import FlaskTestCase, catch_warnings, catch_stderr
1717
from werkzeug.http import parse_cache_control_header, parse_options_header
18-
from flask._compat import StringIO, text_type
18+
from flask._compat import StringIO, text_type, implements_iterator
1919

2020

2121
def has_encoding(name):
@@ -485,14 +485,15 @@ def test_streaming_with_context_and_custom_close(self):
485485
app = flask.Flask(__name__)
486486
app.testing = True
487487
called = []
488+
@implements_iterator
488489
class Wrapper(object):
489490
def __init__(self, gen):
490491
self._gen = gen
491492
def __iter__(self):
492493
return self
493494
def close(self):
494495
called.append(42)
495-
def next(self):
496+
def __next__(self):
496497
return next(self._gen)
497498
@app.route('/')
498499
def index():

0 commit comments

Comments
 (0)