Browse Source

Merge pull request #743 from ThomasWaldmann/sprint-branch

fix iterator in testsuite helpers
pull/744/merge
Daniel Neuhäuser 12 years ago
parent
commit
3c5d7bab26
  1. 5
      flask/testsuite/helpers.py

5
flask/testsuite/helpers.py

@ -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…
Cancel
Save