Browse Source

Fixed PyStringIO in tests for 2.x

pull/1208/head
Armin Ronacher 11 years ago
parent
commit
001100bc0b
  1. 7
      flask/testsuite/helpers.py

7
flask/testsuite/helpers.py

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

Loading…
Cancel
Save