jarus / flask-testing

Unittest extensions for Flask
http://pythonhosted.org/Flask-Testing/
Other
502 stars 111 forks source link

Not compatible with flask 1.1.0, released on July 4, 2019 #135

Open codepossible opened 5 years ago

codepossible commented 5 years ago

The dependencies for flask-testing do not include a version of flask. This results in failure when attempting to use with flask 1.1.0 (released on July 4, 2019).

The package is still compatible with 1.0.* version of flask. The latest version that I was able to test with was 1.0.4 (also released on July 4. 2019).

The following error results when using with flask 1.1.0:

File "/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/flask_testing/__init__.py", line 13, in <module> from .utils import TestCase, LiveServerTestCase File "/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/flask_testing/utils.py", line 38, in <module> from flask import json_available, templating, template_rendered ImportError: cannot import name 'json_available' from 'flask' (/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/flask/__init__.py)

Workaround Pin the flask version in requirements.txt file for pip as: flask==1.0.*

crazyguitar commented 5 years ago

Hi,

I have sent a PR #136 to solve this issue.

crazyguitar commented 4 years ago

Seems flask 1.1.1 added back json_available flag.

Flask changelog

Version 1.1.1 Released 2019-07-08

The flask.json_available flag was added back for compatibility with some extensions. It will raise a deprecation warning when used, and will be removed in version 2.0.0. :issue:3288

eruvanos commented 4 years ago

I guess it is still a good idea to fix this, instead of relying on the deprecated json_available.

crazyguitar commented 4 years ago

I guess it is still a good idea to fix this, instead of relying on the deprecated json_available.

I agree

davidism commented 4 years ago

2.0 is imminent, and this still hasn't been fixed, despite us issuing a deprecation warning for a year now. Flask-Testing will no longer work with Flask 2.0 unless this is fixed.

Garrett-R commented 3 years ago

This issue can be closed now, right? Seems the fix (#136) is on master now.