From 001100bc0b3a700540024c410a985c7f9e09f565 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 9 Feb 2014 13:13:31 +0000 Subject: [PATCH] Fixed PyStringIO in tests for 2.x --- flask/testsuite/helpers.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flask/testsuite/helpers.py b/flask/testsuite/helpers.py index d0beee04..cc377587 100644 --- a/flask/testsuite/helpers.py +++ b/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)