forked from orbit-oss/flask
fix iterator in testsuite helpers
This commit is contained in:
parent
8bb972e5ae
commit
af5576a6c5
1 changed files with 3 additions and 2 deletions
|
|
@ -15,7 +15,7 @@ import unittest
|
|||
from logging import StreamHandler
|
||||
from flask.testsuite import FlaskTestCase, catch_warnings, catch_stderr
|
||||
from werkzeug.http import parse_cache_control_header, parse_options_header
|
||||
from flask._compat import StringIO, text_type
|
||||
from flask._compat import StringIO, text_type, implements_iterator
|
||||
|
||||
|
||||
def has_encoding(name):
|
||||
|
|
@ -485,6 +485,7 @@ class StreamingTestCase(FlaskTestCase):
|
|||
app = flask.Flask(__name__)
|
||||
app.testing = True
|
||||
called = []
|
||||
@implements_iterator
|
||||
class Wrapper(object):
|
||||
def __init__(self, gen):
|
||||
self._gen = gen
|
||||
|
|
@ -492,7 +493,7 @@ class StreamingTestCase(FlaskTestCase):
|
|||
return self
|
||||
def close(self):
|
||||
called.append(42)
|
||||
def next(self):
|
||||
def __next__(self):
|
||||
return next(self._gen)
|
||||
@app.route('/')
|
||||
def index():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue