Browse Source

Merge pull request #862 from bikerm16/master

Minor test fixes
pull/842/merge
Kenneth Reitz 11 years ago
parent
commit
4c0253f9fd
  1. 4
      flask/testsuite/ext.py
  2. 2
      flask/testsuite/helpers.py

4
flask/testsuite/ext.py

@ -125,7 +125,9 @@ class ExtImportHookTestCase(FlaskTestCase):
next = tb.tb_next.tb_next next = tb.tb_next.tb_next
if not PY2: if not PY2:
next = next.tb_next next = next.tb_next
self.assert_in('flask_broken/__init__.py', next.tb_frame.f_code.co_filename)
import os.path
self.assert_in(os.path.join('flask_broken', '__init__.py'), next.tb_frame.f_code.co_filename)
def suite(): def suite():

2
flask/testsuite/helpers.py

@ -269,7 +269,7 @@ class SendfileTestCase(FlaskTestCase):
app = flask.Flask(__name__) app = flask.Flask(__name__)
with catch_warnings() as captured: with catch_warnings() as captured:
with app.test_request_context(): with app.test_request_context():
f = open(os.path.join(app.root_path, 'static/index.html')) f = open(os.path.join(app.root_path, 'static/index.html'), mode='rb')
rv = flask.send_file(f) rv = flask.send_file(f)
rv.direct_passthrough = False rv.direct_passthrough = False
with app.open_resource('static/index.html') as f: with app.open_resource('static/index.html') as f:

Loading…
Cancel
Save