zope.testrunner
Zope testrunner script.
What it is and what it does
zope.testrunner is a flexible test runner designed for Python projects that need more control over test organization and execution than the standard unittest runner provides. It discovers and runs unittest.TestCase tests and doctests, and organizes them into layers—groups of tests that share setup and teardown code executed once per layer rather than per test. The runner supports filtering tests by package, module, or name pattern; grouping slow tests into levels; measuring coverage; profiling; and running tests in parallel.
The package is typically used in buildout-based projects via zc.recipe.testrunner, which generates a test script, or installed directly into a virtualenv and invoked from the command line. It expects tests to live in a tests subpackage or module within your source tree, following standard naming conventions. It integrates with zope.exceptions and zope.interface for error handling and interface support, and provides a rich set of command-line options for controlling test discovery, verbosity, debugging, and output formats including XML reports.
Use it for:
- Run tests organized into layers with shared setup/teardown to avoid redundant initialization across test groups
- Filter and run specific tests by package, module, or name pattern without modifying code
- Measure test coverage and profile test execution to identify slow or resource-intensive tests
- Debug test failures interactively with post-mortem debugging enabled via --pdb
- Generate XML test reports for CI/CD integration and test result tracking
- Run tests in parallel across multiple processes to speed up large test suites
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A test runner for Python projects with support for test layers, filtering by package/module/name, coverage measurement, profiling, and parallel execution.
Yes, if you are working within the Zope ecosystem or need test layer support and advanced filtering. The package is actively maintained, has low install friction, and supports current Python versions. However, verify the ZPL-2.1 license terms for your use case, and consider whether its layer-based organization and command-line interface fit your testing workflow better than pytest or unittest alone.
Install
zope-testrunner on PyPI
pip
pip install zope-testrunneruv
uv add zope-testrunnerpoetry
poetry add zope-testrunnerInstalling zope.testrunner
Before you install
Low install friction; pure Python wheel with only two runtime dependencies (zope.exceptions and zope.interface). Actively maintained with a release 15 days ago; supports current Python versions from 3.10 through 3.14.
License in practice
Licensed under ZPL-2.1 (Zope Public License 2.1), but license treatment is marked unclear in the metadata. Verify the actual license terms before use in proprietary or restricted-license projects.
Quickstart
pip install zope.testrunner
zope-testrunner --test-path=path/to/your/source/tree
# Or in code:
import unittest
from zope.testrunner import runner
runner.run(unittest.TestLoader().discover('tests'))
Requires Python 3.10 or later. Source code must be importable from the test path (install with pip install -e . or equivalent).
Verify before relying
- Whether the unclear license treatment affects commercial use or redistribution
- Performance characteristics when running tests in parallel across large suites
- Compatibility with modern pytest ecosystem and pytest plugins
Package facts
| License | ZPL-2.1 (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — zope.exceptions, zope.interface |
| Maintenance | actively maintained — 15 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 116,870/month — #12,190 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: zope_testrunner-8.3-py3-none-any.whl
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.testingProvides testing utilities and frameworks for…
unclear · top 15,000 on PyPI
zope.testbrowserzope.testbrowser provides a programmable web…
unclear · top 15,000 on PyPI
html-testRunnerA unittest test runner that generates…
permissive · top 15,000 on PyPI
zope.interfaceProvides a Python implementation of object…
unclear · top 1,000 on PyPI
zope.exceptionsProvides general-purpose exception classes and…
unclear · top 15,000 on PyPI
unittest-xml-reportingA unittest test runner that exports test…
permissive · top 5,000 on PyPI
xmlrunnerA unittest test runner that exports test…
copyleft · top 15,000 on PyPI
zope.componentImplements the core Zope Component Architecture…
unclear · top 5,000 on PyPI
ZopeZope is an open-source web application server…
unclear · top 15,000 on PyPI
zope.contentproviderProvides a framework for building componentized…
unclear · top 15,000 on PyPI