Skip to content

Commit

Permalink
Fix import json_available error (#136)
Browse files Browse the repository at this point in the history
* Fix import json_available broken

* Flask 1.1.0 or above remove json_available. ref: d362399e

Signed-off-by: chang-ning <spiderpower02@gmail.com>

* Add environment FLASK=1.1.0 & FLASK=1.0.2

Signed-off-by: chang-ning <spiderpower02@gmail.com>

* Add environment python3.6

Signed-off-by: chang-ning <spiderpower02@gmail.com>
  • Loading branch information
crazyguitar committed Apr 13, 2020
1 parent 84bdbe0 commit 7f307d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
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.
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

0 comments on commit 7f307d8

Please sign in to comment.