pytest-flask
An extension of pytest test runner which provides a set of useful tools to simplify testing and development of the Flask extensions and applications.
To view a more detailed list of extension features and examples go to the PyPI overview page or package documentation.
How to start?
Considering the minimal flask application factory bellow in myapp.py as an example:
from flask import Flask
def create_app(config_filename):
# create a minimal app
app = Flask(__name__)
app.config.from_pyfile(config_filename)
# simple hello world view
@app.route('/hello')
def hello():
return 'Hello, World!'
return appYou first need to define your application fixture in conftest.py:
from myapp import create_app
@pytest.fixture
def app():
app = create_app()
return appFinally, install the extension with dependencies and run your test suite:
$ pip install pytest-flask $ pytest
Contributing
Don’t hesitate to create a GitHub issue for any bug or suggestion.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
