跳转到主要内容

使用Attest测试Flask应用程序

项目描述

Flask的扩展,用于使用Attest进行自动化测试。

特性

  • 类似Flask的API

  • 在测试中处理请求上下文

  • 捕获渲染模板的元数据

  • 灵活的库,假设很少

  • 使用断言语句自然地编写测试条件

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

项目详情


由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面