Skip to main content

Test Flask applications with Attest

Project description

An extension of Flask for automated testing using Attest.

Features:

  • Flask-like API
  • Handling of request contexts in tests
  • Captures metadata about rendered templates
  • Flexible library with few assumptions
  • Write test conditions naturally with the assert statement
from flaskext.attest import request_context, get
from myapp import app
from attest import Tests
from flask import Response

TESTING = True

@request_context
def testapp():
    app.config.from_object(__name__)
    return app

frontend = Tests(context=[testapp])

@frontend.test
@get('/')
def index(response):
    assert response == Response('Welcome!')

Project details


Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page