zope.testing
Zope testing helpers
What it is and what it does
zope.testing is a collection of testing utilities built around doctest and unittest workflows. It provides helpers for common testing patterns: cleanup mixins for tests that modify global state, HTML form parsing for functional tests, logging output verification, and setup/teardown automation via setupstack. The package also includes output normalization via regex patterns (useful for doctests with non-deterministic output) and a timing utility for handling race conditions.
The package is designed primarily for doctest-heavy projects and Zope framework users, though its individual modules (like renormalizing and setupstack) can be used standalone. It has no runtime dependencies, making it lightweight to add to a test suite. Recent versions have deprecated doctestcase in favor of Python's built-in doctest module, signaling a shift toward standard library patterns.
Use it for:
- Verify logging output in unit tests using loggingsupport handlers.
- Extract and validate form data from HTML responses in functional tests with formparser.
- Normalize doctest output with regex patterns to handle timestamps or variable data.
- Automate setup and teardown in doctests using setupstack to avoid global state pollution.
- Handle timing-dependent test failures with the wait utility for non-deterministic operations.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides testing utilities and frameworks for Python, including doctest support, form parsing, logging verification, and setup/teardown automation.
Yes. zope.testing is actively maintained, has zero known vulnerabilities, requires no external dependencies, and supports current Python versions (3.10+). It is worth installing if you use doctests or need any of its specialized testing utilities (form parsing, logging verification, output normalization). If you only use unittest or pytest with standard patterns, you may not need it.
Install
zope-testing on PyPI
pip
pip install zope-testinguv
uv add zope-testingpoetry
poetry add zope-testingInstalling zope.testing
Before you install
Low install friction with no runtime dependencies. Actively maintained with recent releases; latest version 6.2 added Python 3.15 support and moved metadata to pyproject.toml.
License in practice
Licensed under ZPL-2.1 (Zope Public License 2.1), a permissive open-source license with no notable restrictions for most use cases.
Quickstart
pip install zope.testing
from zope.testing import setupstack
from zope.testing.renormalizing import OutputChecker
# Use setupstack for doctest setup/teardown automation
# Use OutputChecker for regex-based output normalization in tests
Requires Python 3.10 or later.
Verify before relying
- Whether formparser HTML extraction works with modern HTML5 parsers or only legacy HTML.
- Performance characteristics when used with large test suites or complex doctest files.
- Compatibility with test runners other than nose (e.g., pytest, unittest discovery).
Package facts
| License | ZPL-2.1 (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 42 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 256,994/month — #8,452 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: zope_testing-6.2-py3-none-any.whl
Keywords: zope, testing, doctest, RENormalizing, OutputChecker, timeout, logging
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
zope.exceptionsProvides general-purpose exception classes and…
unclear · top 15,000 on PyPI
zope.testrunnerA test runner for Python projects with support…
unclear · top 15,000 on PyPI
zope.deprecationProvides a decorator and utilities to mark…
unclear · top 5,000 on PyPI
zope.browserProvides a set of standard interfaces for…
unclear · top 15,000 on PyPI
zope.datetimeParses and formats date/time strings in common…
unclear · top 15,000 on PyPI
zope.testbrowserzope.testbrowser provides a programmable web…
unclear · top 15,000 on PyPI
zope.viewletzope.viewlet provides a pluggable framework for…
unclear · top 15,000 on PyPI
pytest-doctestplusA pytest plugin that runs doctests in Python…
permissive · top 15,000 on PyPI
zExceptionszExceptions provides a collection of exception…
unclear · top 15,000 on PyPI
xdoctestXdoctest finds and executes test code embedded…
permissive · top 5,000 on PyPI