$npx skillfedfor your agent

pytest-reraise

Make multi-threaded pytest test cases fail when they should

With conditionsPyPI LibrariesReleased Sep 2022180.4K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pytest_reraise-2.1.2-py3-none-any.whl
v2.1.2 · released 2022-09-20 · Python >=3.6.1,<4.0.0 · 1 runtime deps: pytest

Yes, if you actively write multi-threaded pytest tests and need thread exceptions to fail your tests. The low install friction and permissive license make adoption easy. However, the abandoned maintenance status (last commit 2023-02-06) is a concern—verify compatibility with your pytest and Python versions before relying on it for new projects, and monitor for any unresolved issues with newer releases.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction: pure Python wheel with only pytest as a runtime dependency.
  • Maintenance is stalled—last commit was 2023-02-06 and the package is marked abandoned, though it remains marked Production/Stable and has received no security reports.

License · maintenance · safety

MIT (permissive) — MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

last release 2022-09-20 (1424 days) · last repo commit 2023-02-06 · 20 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 180,427 downloads/mo, #10,145 on PyPI

Verify before relying

pip install pytest-reraise

# In your test file:
from threading import Thread

def test_with_thread(reraise):
    def run():
        with reraise:
            assert False
    Thread(target=run).start()
  • Whether the package works reliably with pytest versions released after 2023-02-06
  • Whether the abandoned status indicates unresolved bugs or compatibility issues with newer Python or pytest releases
Same gist for agents: .md · .json

What it is and what it does

pytest-reraise is a pytest plugin that solves a specific threading problem: when you write assertions inside a thread spawned from a test, those assertions fail silently because the exception is raised in the thread, not the main test thread. The plugin provides a `reraise` fixture that acts as a context manager to capture exceptions from worker threads and re-raise them in the main thread at the end of the test, making the test fail as expected.

The plugin supports wrapping functions as decorators, manually triggering re-raises mid-test, handling multiple exceptions (keeping the first), optionally catching exceptions to prevent them from crashing the thread, and accessing or resetting captured exceptions. It's designed for developers writing multi-threaded tests who need pytest to properly detect assertion failures that occur in spawned threads.

Use it for

  • Testing concurrent code where worker threads perform assertions that must be validated by the main test
  • Verifying that background tasks or thread pools fail correctly when they encounter errors
  • Debugging multi-threaded applications by ensuring thread exceptions don't silently pass tests
  • Wrapping thread target functions with exception capture to keep threads alive while collecting errors
  • Comparing captured thread exceptions against expected error types or messages in test assertions

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you actively write multi-threaded pytest tests and need thread exceptions to fail your tests.

The low install friction and permissive license make adoption easy. However, the abandoned maintenance status (last commit 2023-02-06) is a concern—verify compatibility with your pytest and Python versions before relying on it for new projects, and monitor for any unresolved issues with newer releases.

Install

pytest-reraise on PyPI

Before you install

Low friction: pure Python wheel with only pytest as a runtime dependency. Maintenance is stalled—last commit was 2023-02-06 and the package is marked abandoned, though it remains marked Production/Stable and has received no security reports.

License in practice

MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install pytest-reraise

# In your test file:
from threading import Thread

def test_with_thread(reraise):
    def run():
        with reraise:
            assert False
    Thread(target=run).start()

Verify before relying

  • Whether the package works reliably with pytest versions released after 2023-02-06
  • Whether the abandoned status indicates unresolved bugs or compatibility issues with newer Python or pytest releases

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.6.1,<4.0.0
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
pytest
MaintenanceAbandoned 1,424 days since the last release
Last repo commit
First released
Downloads180,427 / month, #10,145 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTyping :: Typed

Evidence: pytest_reraise-2.1.2-py3-none-any.whl

Tags

Capabilities
pytest thread exception handlingmulti-threaded test assertionscapture exceptions in threadspytest plugin threadingthread assertion failurespytest reraise decoratortest thread error detection
Topics
pytest-pluginthreadingtest-utilities
PyPI keywords
pytestpluginthreadsexceptionassertcatchraisere-raise

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 thread exception handling”

Give your agent the search over MCP, or paste the wish link into any chat.

More Libraries packages

urllib3 Worth it
PyPI · Libraries · released May 2026

urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.

MITpure Python · 3.10+
1.8Bdownloads / mo
requests Worth it
PyPI · Libraries · released May 2026

Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.

Apache-2.0pure Python · 3.10+
1.8Bdownloads / mo
pluggy Worth it
PyPI · Libraries · released May 2025

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.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
python-dateutil Worth it
PyPI · Libraries · released Mar 2024

Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.

Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.

Apache-2.0pure Python
1.2Bdownloads / mo
six With conditions
PyPI · Libraries · released Dec 2024

Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.

MITpure Python
1.2Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

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.

MITpure Python · 3.10+
1.1Bdownloads / mo

See also outcome · pytest-assume · pytest-raises · pytest-race · re-assert · pytest-run-parallel · softest · kthread · pytest-rerunfailures · pytest-check