跳转到主要内容

zope pytest集成

项目描述

zope.pytest

简介

本软件包包含一组辅助函数,用于通过 pytest 测试 Zope/Grok。它目前缺乏对 doctesting 的特殊支持。

核心函数

zope.pytest.setup.create_app

  • 此函数创建一个使用临时数据库的 WSGI 应用程序对象。

zope.pytest.setup.configure

  • 此函数解析 ZCML 文件并初始化组件注册表。

简单示例

import my.project
from zope.pytest import create_app, configure
from my.project import Root

def pytest_funcarg__app(request):
    return create_app(request, Root())

def pytest_funcarg__config(request):
    return configure(request, my.project, 'ftesting.zcml')

def test_hello(app, config):
    assert 1 == 1

文档

完整文档可在以下网址找到:

http://packages.python.org/zope.pytest

变更记录

0.1 (2011-03-05)

初始实现。

下载

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源代码分发

zope.pytest-0.1.tar.gz (32.7 kB 查看哈希值)

上传时间 源代码

支持

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