pytest-subtests
unittest subTest() support and subtests fixture
Decision gist · record as of 2026-08-14
Yes, if you need subTest() support in pytest and do not require ongoing maintenance. The plugin is stable and works with modern Python versions (3.9–3.13), has no known vulnerabilities, and low install friction. However, the abandoned status means no fixes or updates for future pytest or Python releases—use it only if you accept that risk or have a fallback plan.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Low install friction with only two runtime dependencies (attrs and pytest).
- However, the repository is archived and marked abandoned as of the latest maintenance status, meaning no active development or support.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
last release 2025-10-20 (298 days) · last repo commit 2025-11-10 · 256 stars · archived
0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,875,378 downloads/mo, #2,209 on PyPI
Alternatives
Verify before relying
pip install pytest-subtests
# In your test file:
def test_example(subtests):
for i in range(5):
with subtests.test(msg="iteration", i=i):
assert i % 2 == 0- Whether the abandoned status affects long-term compatibility with future pytest releases.
- Whether there are maintained forks or alternative packages providing similar functionality.
What it is and what it does
pytest-subtests is a pytest plugin that brings unittest's subTest() context manager to pytest, plus a new subtests fixture for pure pytest tests. It lets you run multiple iterations or parameterized checks within a single test function, reporting each failure individually rather than stopping at the first one. This is useful when you want to test many similar cases (like iterating over a list of inputs) and see all failures at once instead of fixing them one by one.
The plugin depends only on pytest and attrs, and supports Python 3.9 through 3.13. It is classified as Beta and distributed under the MIT license. However, the repository is archived and no longer maintained, so while it works with current pytest versions, there is no active development or support for future changes.
Use it for
- Running the same assertion across multiple test inputs and seeing all failures in one test run.
- Converting existing unittest code that uses subTest() to work under pytest without rewriting tests.
- Parameterized testing where you want individual failure reporting for each iteration.
- Testing collections or ranges of values where partial failures should not halt the entire test.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need subTest() support in pytest and do not require ongoing maintenance.
The plugin is stable and works with modern Python versions (3.9–3.13), has no known vulnerabilities, and low install friction. However, the abandoned status means no fixes or updates for future pytest or Python releases—use it only if you accept that risk or have a fallback plan.
Install
pytest-subtests on PyPI
Before you install
Low install friction with only two runtime dependencies (attrs and pytest). However, the repository is archived and marked abandoned as of the latest maintenance status, meaning no active development or support.
Requires Python 3.9 or later.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install pytest-subtests
# In your test file:
def test_example(subtests):
for i in range(5):
with subtests.test(msg="iteration", i=i):
assert i % 2 == 0
Verify before relying
- Whether the abandoned status affects long-term compatibility with future pytest releases.
- Whether there are maintained forks or alternative packages providing similar functionality.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesattrspytest |
| Maintenance | Abandoned 298 days since the last release |
| Last repo commit | repository archived |
| First released | |
| Downloads | 4,875,378 / month, #2,209 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: TestingTyping :: Typed |
Evidence: pytest_subtests-0.15.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pytest subtest support”
- pytest-subtestsAdds subTest() support to pytest, allowing unittest-style…
- pytest-runnerEnables running pytest tests through setup.py by integrating pytest…
- pytest-asynciopytest-asyncio is a pytest plugin that enables writing and running…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also pytest-item-dict · pytest-logging · pytest-assume · parametrize · testscenarios · softest · pytest-error-for-skips · unittest-parametrize · kgb