Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Test Flask applications with Attest
Python
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
docs
examples
flaskext
.gitignore
.gitmodules
LICENSE
MANIFEST.in
README.rst
logo.svg
setup.cfg
setup.py
tests.py
tox.ini

README.rst

Flask-Attest

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!')
Something went wrong with that request. Please try again.