From cff35237efea11c4bbc8c2fc75e24cbea30b26ce Mon Sep 17 00:00:00 2001 From: Michael Bikovitsky Date: Sat, 7 Sep 2013 18:21:15 +0300 Subject: [PATCH 1/2] Fix test_no_error_swallowing Path in assertion is now cross-platform. --- flask/testsuite/ext.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flask/testsuite/ext.py b/flask/testsuite/ext.py index 5cc3df43..7bdf6886 100644 --- a/flask/testsuite/ext.py +++ b/flask/testsuite/ext.py @@ -125,7 +125,9 @@ class ExtImportHookTestCase(FlaskTestCase): next = tb.tb_next.tb_next if not PY2: 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(): From b7337080e48990393cf960890504710bc7cbc136 Mon Sep 17 00:00:00 2001 From: Michael Bikovitsky Date: Sat, 7 Sep 2013 18:29:49 +0300 Subject: [PATCH 2/2] Fix test_send_file_object static/index.html now opens in binary mode, and therefore newline conversion does not take place. --- flask/testsuite/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask/testsuite/helpers.py b/flask/testsuite/helpers.py index 7de70c0a..4bb43ac2 100644 --- a/flask/testsuite/helpers.py +++ b/flask/testsuite/helpers.py @@ -260,7 +260,7 @@ class SendfileTestCase(FlaskTestCase): app = flask.Flask(__name__) with catch_warnings() as captured: 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.direct_passthrough = False with app.open_resource('static/index.html') as f: