Zope Pytest集成

zope.pytest的Python项目详细描述


zope.pytest

简介

这个包包含一组帮助函数来测试zope/grok 使用pytest。它目前缺乏对治疗的特殊支持

核心功能

zope.pytest.setup.create_app

  • this function creates a WSGI app object which utilizes a temporary db.

zope.pytest.setup.configure

  • this function parses ZCML files and initializes the component registry

简单示例:

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)

初步实施

下载

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
JavaSpringMVC控制器测试打印结果JSON字符串   若catch语句返回,那个么为什么它最终会阻塞呢?   java Grails中servletContext在哪里可用?   java Jhipster:如何为现有项目启用多种语言   java异常评估SpringEL表达式:“#fields.hasErrors('something')”   java如何验证SeleniumWebDriver中的文本颜色?   java在绘图时使用JPanel坐标   java如何初始化spring启动到project?   java如何通过JDBC的PreparedStatement将UUID数组插入HyperSQL数据库   java修改JVM以跨线程序列化文件访问   Javascript到Java正则表达式   使用Java运行时调用aspell程序时出现字符集问题。getRuntime()。执行官   执行RDP时的java Sukuli按钮识别   java如何使用okhttp更改connect请求的标头   java无法创建Maven Eclipse项目