flask-testing icon indicating copy to clipboard operation
flask-testing copied to clipboard

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

Open codepossible opened this issue 4 years ago • 6 comments

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.*

codepossible avatar Jul 05 '19 22:07 codepossible

Hi,

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

crazyguitar avatar Jul 06 '19 01:07 crazyguitar

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

crazyguitar avatar Jul 09 '19 01:07 crazyguitar

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

eruvanos avatar Jul 09 '19 12:07 eruvanos

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

I agree

crazyguitar avatar Jul 10 '19 05:07 crazyguitar

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.

davidism avatar Apr 04 '20 13:04 davidism

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

Garrett-R avatar Dec 23 '20 00:12 Garrett-R