How to install zope.pytest
- Download and install ActivePython
- Open Command Prompt
- Type
pypm install zope.pytest
Dependencies
- distribute
- simplejson
- WebOb
- ZODB3
- zope.app.publication
- zope.app.wsgi
- zope.component
- zope.configuration
- zope.event
- zope.processlifetime
- zope.testing
- [docs] docutils
- [docs] infrae.testbrowser
- [docs] pytest
- [docs] roman
- [docs] Sphinx
- [docs] zope.app.appsetup
- [docs] zope.app.zcmlfiles
- [docs] zope.browserpage
- [docs] zope.securitypolicy
- [tests] infrae.testbrowser
- [tests] pytest
- [tests] zope.app.appsetup
- [tests] zope.app.zcmlfiles
- [tests] zope.browserpage
- [tests] zope.securitypolicy
Lastest release
zope.pytest
Introduction
This package contains a set of helper functions to test Zope/Grok using pytest. It currently lacks special support for doctesting.
Core functions
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
Simple example:
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
CHANGES
0.1 (2011-03-05)
Initial implementation.