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

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page