Fixed PyStringIO in tests for 2.x

This commit is contained in:
Armin Ronacher 2014-02-09 13:13:31 +00:00
parent 8cb79fd026
commit 001100bc0b

View file

@ -265,8 +265,11 @@ class SendfileTestCase(FlaskTestCase):
# etags
self.assert_equal(len(captured), 1)
with catch_warnings() as captured:
class PyStringIO(StringIO):
pass
class PyStringIO(object):
def __init__(self, *args, **kwargs):
self._io = StringIO(*args, **kwargs)
def __getattr__(self, name):
return getattr(self._io, name)
f = PyStringIO('Test')
f.name = 'test.txt'
rv = flask.send_file(f)