Created by: YusukeHosonuma
As a result of the release of Flask 2.0, the python-flask tests in TravisCI seem to be failing.
==================================== ERRORS ====================================
_________ ERROR collecting openapi_server/test/test_pet_controller.py __________
ImportError while importing test module '/home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/openapi_server/test/test_pet_controller.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
openapi_server/test/__init__.py:4: in <module>
from flask_testing import TestCase
.tox/py3/lib/python3.6/site-packages/flask_testing/__init__.py:13: in <module>
from .utils import TestCase, LiveServerTestCase
.tox/py3/lib/python3.6/site-packages/flask_testing/utils.py:38: in <module>
from flask import json_available, templating, template_rendered
E ImportError: cannot import name 'json_available'
...
!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 3 error in 1.41 seconds ============================
ERROR: InvocationError for command /home/travis/build/OpenAPITools/openapi-generator/samples/server/petstore/python-flask/.tox/py3/bin/pytest --cov=openapi_server (exited with code 2)
The cause seems to be that the flask.json_available
flag was removed in 2.0.0.
Version 1.1.1
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. #3288 (closed)
- https://flask.palletsprojects.com/en/1.1.x/changelog/#version-1-1-1
- https://github.com/pallets/flask/pull/3292
- https://github.com/pallets/flask/issues/3288
In this PR, as a temporary measure, I will fix the Flask version to 1.1.2.
PR checklist
-
Read the contribution guidelines. -
Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community. -
Run the following to build the project and update samples: ./mvnw clean package ./bin/generate-samples.sh ./bin/utils/export_docs_generators.sh
./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH. -
File the PR against the correct branch: master
,5.1.x
,6.0.x
-
If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.
@taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @arun-nalla (2019/11) @spacether (2019/11)
and @wing328 (Since it appeared that they were investigating this issue)
I hope this is helpful.