Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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!')
Release History

Release History

This version
History Node

0.1dev

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting