Registry / testing / crashtest

crashtest

JSON →
library0.4.1pypypi✓ verified 44d ago

Crashtest is a Python library designed to simplify the handling and inspection of exceptions, providing tools to manage Python errors with ease. It is currently at version 0.4.1 and has a moderate release cadence, with recent updates focused on stability and type hinting.

testingobservability
pip install crashtest
Install & Compatibility
Where this runs
tested against v0.4.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
3/5 runs
3/5 runs
py 3.11
3/5 runs
3/5 runs
py 3.12
3/5 runs
3/5 runs
py 3.13
3/5 runs
3/5 runs
py 3.9
3/5 runs
3/5 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

annotations
from crashtest import annotations
from crashtest import Inspector

Demonstrates how to use the `Inspector` class to extract detailed information from a caught exception, including its type, message, and the full stack trace with code context.

import sys from crashtest import Inspector def might_fail(): a = 1 b = 0 return a / b try: might_fail() except Exception as e: inspector = Inspector(e) print(f"Exception type: {inspector.type}") print(f"Exception message: {inspector.message}") print("Stack Trace:") for frame in inspector.frames: print(f" File: {frame.file}, Line: {frame.lineno}, Function: {frame.name}") print(f" Code: {frame.line.strip() if frame.line else 'N/A'}")
Debug
Known issues
breakingCrashtest versions 0.4.0 and newer require Python 3.7 or higher. Users on Python 3.6 or older will encounter compatibility issues when upgrading.
fix
Upgrade your Python environment to 3.7 or newer, or pin `crashtest` to a version older than 0.4.0 (e.g., `<0.4.0`).
affects: >=0.4.0
gotchaVersion 0.4.0 introduced stricter type hinting. A 'too narrow type' in the `Inspector` class was fixed in 0.4.1, suggesting that `0.4.0` might have introduced new type-related errors if existing code passed unexpected types.
fix
Update to `crashtest` 0.4.1 or later to benefit from the corrected type definitions and avoid potential type-related runtime errors.
affects: 0.4.0
gotchaPrior to version 0.4.0, `crashtest` could encounter decoding errors when opening files due to the lack of explicit 'utf-8' encoding.
fix
Upgrade to `crashtest` 0.4.0 or later to ensure proper handling of file encodings.
affects: <0.4.0
gotchaIn versions prior to 0.3.1, there was an error when attempting to retrieve the line of a frame if it had no context.
fix
Upgrade to `crashtest` 0.3.1 or later to fix issues with context-less frame line retrieval.
affects: <0.3.1
breakingThe `Inspector` class was moved from being directly available under the `crashtest` package to `crashtest.inspector` in version 0.4.0. Attempts to import it directly via `from crashtest import Inspector` will result in an `ImportError` in versions 0.4.0 and newer.
fix
Update import statements from `from crashtest import Inspector` to `from crashtest.inspector import Inspector` to correctly import the class.
affects: >=0.4.0
Upgrade
Version history
0.4.1latest on PyPI
Audit
Dependencies

No dependency data recorded yet.

Agent activity
55 hits · last 30 days
mj12bot
4
seranking-bot
4
node
2
ahrefsbot
2
amazonbot
1
Resources