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

[python][flask] Fix to failed tests on TravisCI #9471

Merged
merged 1 commit into from
May 13, 2021

Conversation

YusukeHosonuma
Copy link
Contributor

@YusukeHosonuma YusukeHosonuma commented May 13, 2021

As a result of the release of Flask 2.0, the python-flask tests in TravisCI seem to be failing.

For example:

==================================== 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

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
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./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.

@YusukeHosonuma YusukeHosonuma marked this pull request as ready for review May 13, 2021 07:18
@wing328
Copy link
Member

wing328 commented May 13, 2021

@YusukeHosonuma thank you for the timely fix 👍

@wing328
Copy link
Member

wing328 commented May 13, 2021

Circle CI failure not related to this change.

@wing328 wing328 merged commit 44efb7a into OpenAPITools:master May 13, 2021
@wing328 wing328 added this to the 5.2.0 milestone May 13, 2021
@YusukeHosonuma YusukeHosonuma deleted the patch/python-flask branch May 13, 2021 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants