Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !9471

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

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/YusukeHosonuma/patch/python-flask into master May 13, 2021
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: YusukeHosonuma

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

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/YusukeHosonuma/patch/python-flask