Skip to content
This repository has been archived by the owner on Oct 31, 2019. It is now read-only.

Commit

Permalink
Read json file in text mode to support Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieClarken committed Aug 12, 2015
1 parent db9a06f commit 73f1bcd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
language: 'python'
python: '2.7'
python:
- '2.7'
- '3.4'

before_install:
- 'pip install setuptools flake8 pytest'
Expand Down
2 changes: 1 addition & 1 deletion flask_webpack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _set_asset_paths(self, app):
webpack_stats = app.config['WEBPACK_MANIFEST_PATH']

try:
with app.open_resource(webpack_stats) as stats_json:
with app.open_resource(webpack_stats, 'r') as stats_json:
stats = json.load(stats_json)

if app.config['WEBPACK_ASSETS_URL']:
Expand Down
9 changes: 5 additions & 4 deletions flask_webpack/tests/test_app/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def test_index_page(client):
js = 'app_js.8b7c0de88caa3f366b53.js'
image = 'images/dog/no-idea.b9252d5fd8f39ce3523d303144338d7b.jpg'

assert asset_path in response.data
assert css in response.data
assert js in response.data
assert image in response.data
response_data = response.data.decode('utf-8')
assert asset_path in response_data
assert css in response_data
assert js in response_data
assert image in response_data

0 comments on commit 73f1bcd

Please sign in to comment.