Skip to content

Commit 90e3906

Browse files
committed
Fixed some test failures
1 parent 9ae8487 commit 90e3906

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

flask/testsuite/basic.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ def teardown_request1(exc):
513513
# test that all teardown_requests get passed the same original
514514
# exception.
515515
try:
516-
raise TypeError
516+
raise TypeError()
517517
except:
518518
pass
519519
@app.teardown_request
@@ -524,7 +524,7 @@ def teardown_request2(exc):
524524
# test that all teardown_requests get passed the same original
525525
# exception.
526526
try:
527-
raise TypeError
527+
raise TypeError()
528528
except:
529529
pass
530530
@app.route('/')
@@ -1098,7 +1098,9 @@ def test_module_static_path_subdomain(self):
10981098
app.register_module(mod)
10991099
c = app.test_client()
11001100
rv = c.get('/static/hello.txt', 'http://foo.example.com/')
1101+
rv.direct_passthrough = False
11011102
self.assert_equal(rv.data.strip(), b'Hello Subdomain')
1103+
rv.close()
11021104

11031105
def test_subdomain_matching(self):
11041106
app = flask.Flask(__name__)

flask/testsuite/blueprints.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ def test_templates_and_static(self):
371371
rv = c.get('/admin/static/css/test.css')
372372
cc = parse_cache_control_header(rv.headers['Cache-Control'])
373373
self.assert_equal(cc.max_age, expected_max_age)
374+
rv.close()
374375
finally:
375376
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = max_age_default
376377

flask/testsuite/helpers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ def test_send_file_object(self):
206206
with catch_warnings() as captured:
207207
f = StringIO('Test')
208208
rv = flask.send_file(f)
209+
rv.direct_passthrough = False
209210
self.assert_equal(rv.data, b'Test')
210211
self.assert_equal(rv.mimetype, 'application/octet-stream')
211212
rv.close()
@@ -214,6 +215,7 @@ def test_send_file_object(self):
214215
with catch_warnings() as captured:
215216
f = StringIO('Test')
216217
rv = flask.send_file(f, mimetype='text/plain')
218+
rv.direct_passthrough = False
217219
self.assert_equal(rv.data, b'Test')
218220
self.assert_equal(rv.mimetype, 'text/plain')
219221
rv.close()

0 commit comments

Comments
 (0)