diff --git a/flask/testsuite/basic.py b/flask/testsuite/basic.py index 8cd3a822..bd5b2760 100644 --- a/flask/testsuite/basic.py +++ b/flask/testsuite/basic.py @@ -513,7 +513,7 @@ class BasicFunctionalityTestCase(FlaskTestCase): # test that all teardown_requests get passed the same original # exception. try: - raise TypeError + raise TypeError() except: pass @app.teardown_request @@ -524,7 +524,7 @@ class BasicFunctionalityTestCase(FlaskTestCase): # test that all teardown_requests get passed the same original # exception. try: - raise TypeError + raise TypeError() except: pass @app.route('/') @@ -1098,7 +1098,9 @@ class SubdomainTestCase(FlaskTestCase): app.register_module(mod) c = app.test_client() rv = c.get('/static/hello.txt', 'http://foo.example.com/') + rv.direct_passthrough = False self.assert_equal(rv.data.strip(), b'Hello Subdomain') + rv.close() def test_subdomain_matching(self): app = flask.Flask(__name__) diff --git a/flask/testsuite/blueprints.py b/flask/testsuite/blueprints.py index 5935a473..3414eeaa 100644 --- a/flask/testsuite/blueprints.py +++ b/flask/testsuite/blueprints.py @@ -371,6 +371,7 @@ class BlueprintTestCase(FlaskTestCase): rv = c.get('/admin/static/css/test.css') cc = parse_cache_control_header(rv.headers['Cache-Control']) self.assert_equal(cc.max_age, expected_max_age) + rv.close() finally: app.config['SEND_FILE_MAX_AGE_DEFAULT'] = max_age_default diff --git a/flask/testsuite/helpers.py b/flask/testsuite/helpers.py index 20c15262..7750ae52 100644 --- a/flask/testsuite/helpers.py +++ b/flask/testsuite/helpers.py @@ -206,6 +206,7 @@ class SendfileTestCase(FlaskTestCase): with catch_warnings() as captured: f = StringIO('Test') rv = flask.send_file(f) + rv.direct_passthrough = False self.assert_equal(rv.data, b'Test') self.assert_equal(rv.mimetype, 'application/octet-stream') rv.close() @@ -214,6 +215,7 @@ class SendfileTestCase(FlaskTestCase): with catch_warnings() as captured: f = StringIO('Test') rv = flask.send_file(f, mimetype='text/plain') + rv.direct_passthrough = False self.assert_equal(rv.data, b'Test') self.assert_equal(rv.mimetype, 'text/plain') rv.close()