Fixed some test failures
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parent 9ae8487 · Browse files · 3 files·+7 added−2 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+7 added−2 removed
- other:+7 added−2 removed
Provenance
- Commit
90e3906- Tree
59d6277- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
9ae8487
3 files changed+7 added−2 removed
modified:flask/testsuite/basic.py+4 added-2 removed
511 unmodified lines512 # This raises a new error and blows away sys.exc_info(), so we can513 # test that all teardown_requests get passed the same original514 # exception.515 try:516- raise TypeError516+ raise TypeError()517 except:518 pass519 @app.teardown_request520 def teardown_request2(exc):2 unmodified lines523 # This raises a new error and blows away sys.exc_info(), so we can524 # test that all teardown_requests get passed the same original525 # exception.526 try:527- raise TypeError527+ raise TypeError()528 except:529 pass530 @app.route('/')531 def fails():565 unmodified lines1097 from subdomaintestmodule import mod1098 app.register_module(mod)1099 c = app.test_client()1100 rv = c.get('/static/hello.txt', 'http://foo.example.com/')1101+ rv.direct_passthrough = False1102 self.assert_equal(rv.data.strip(), b'Hello Subdomain')1103+ rv.close()1104 1105 def test_subdomain_matching(self):1106 app = flask.Flask(__name__)1107 app.config['SERVER_NAME'] = 'localhost'47 unmodified linesmodified:flask/testsuite/blueprints.py+1 added
369 unmodified lines370 app.config['SEND_FILE_MAX_AGE_DEFAULT'] = expected_max_age371 rv = c.get('/admin/static/css/test.css')372 cc = parse_cache_control_header(rv.headers['Cache-Control'])373 self.assert_equal(cc.max_age, expected_max_age)374+ rv.close()375 finally:376 app.config['SEND_FILE_MAX_AGE_DEFAULT'] = max_age_default377 378 with app.test_request_context():393 unmodified linesmodified:flask/testsuite/helpers.py+2 added
204 unmodified lines205 with app.test_request_context():206 with catch_warnings() as captured:207 f = StringIO('Test')208 rv = flask.send_file(f)209+ rv.direct_passthrough = False210 self.assert_equal(rv.data, b'Test')211 self.assert_equal(rv.mimetype, 'application/octet-stream')212 rv.close()213 # etags214 self.assert_equal(len(captured), 1)215 with catch_warnings() as captured:216 f = StringIO('Test')217 rv = flask.send_file(f, mimetype='text/plain')218+ rv.direct_passthrough = False219 self.assert_equal(rv.data, b'Test')220 self.assert_equal(rv.mimetype, 'text/plain')221 rv.close()222 # etags319 unmodified lines