--- id: pytest-subtests version: "0.15.0" license: MIT license_treatment: permissive maintenance: abandoned --- # pytest-subtests — unittest subTest() support and subtests fixture License: permissive · Maintenance: abandoned · Downloads: 4.9M/mo ## 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 above — verify before relying. Adds subTest() support to pytest, allowing unittest-style parameterized test iterations and a subtests fixture for pure pytest tests to report individual failures within a single test function. 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 pip install pytest-subtests uv add pytest-subtests poetry add pytest-subtests ## Installing pytest-subtests 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. 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 Requires Python 3.9 or later. 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_current - Install friction: low - Maintenance: abandoned - Downloads: 4.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest subtest support, unittest subTest pytest, parameterized test iterations, pytest subtests fixture, test iteration reporting, nested test failures, unittest-compat, parameterized-testing [View on SkillFed](https://skillfed.io/packages/pytest-subtests) · [View on PyPI](https://pypi.org/project/pytest-subtests/)