Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix import json_available error #136

Merged
merged 4 commits into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ notifications:
email:
- christoph.heer@googlemail.com
- jonathan.como@gmail.com
version: ~> 1.0
version: ~> 1.0
9 changes: 7 additions & 2 deletions flask_testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from werkzeug.utils import cached_property

# Use Flask's preferred JSON module so that our runtime behavior matches.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this comment down to line 51 (where the import happens)?

from flask import json_available, templating, template_rendered
from flask import templating, template_rendered

try:
from flask import message_flashed
Expand All @@ -45,8 +45,13 @@
message_flashed = None
_is_message_flashed = False

if json_available:
json_available = True

try:
from flask import json
except ImportError:
json_available = False


# we'll use signals for template-related tests if
# available in this version of Flask
Expand Down