fix iterator in testsuite helpers

This commit is contained in:
Thomas Waldmann 2013-05-25 19:46:26 +02:00
parent 8bb972e5ae
commit af5576a6c5

View file

@ -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():