skillfed

delayed-assert

Delayed/soft assertions for python

delayed-assert v0.4.2 505.3K downloads/30d#6,292 on PyPI30
License unclear AGING released

What it is and what it does

Delayed-assert is a lightweight testing utility that lets you accumulate assertion failures instead of stopping at the first one. It works with any testing framework (unittest, pytest, etc.) by wrapping assertions in `expect()` calls, then reporting all failures together when you call `assert_expectations()`. You can also use it as a decorator or context manager to avoid the explicit final call.

The package has no external dependencies and integrates cleanly into existing test suites. It supports both simple boolean expressions and lambda-wrapped framework assertions, making it useful for tests that need to validate multiple conditions and report all problems in one batch rather than failing on the first mismatch.

Use it for:

  • Validate multiple related conditions in a single test without stopping at the first failure
  • Batch-check API response fields or data structure properties to see all mismatches at once
  • Run parameterized test assertions where you want to collect all failures before stopping
  • Simplify test output by grouping related assertion failures into one report
  • Integrate soft assertions into existing unittest or pytest suites without framework changes

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Collects multiple assertion failures in a test without stopping execution, then reports them all at the end via a single call or decorator.

Yes, if you need soft assertions in your test suite and can tolerate the unclear license status. The package is dependency-free, low-friction to install, and works with any testing framework. However, verify the license terms first, and note that maintenance is aging—last commit was 250 days ago—so expect slower updates if issues arise.

Install

delayed-assert on PyPI

pip

pip install delayed-assert

uv

uv add delayed-assert

poetry

poetry add delayed-assert

Installing delayed-assert

Before you install

Low friction: pure Python wheel with no runtime dependencies. Maintenance is aging—last commit was 250 days ago—but the repository remains active and unarchived.

License in practice

License status is unclear; no SPDX identifier or raw license text is declared in the package metadata. Verify the actual license terms before use in proprietary or restricted contexts.

Quickstart

pip install delayed-assert

from delayed_assert import expect, assert_expectations

expect(1 == 1)
expect(1 == 2, "This will not stop execution")
assert_expectations()  # Reports all failures at once

Verify before relying

  • Exact Python version compatibility (requires_python is unspecified in metadata)
  • Whether the package is actively maintained or in maintenance-only mode given the 250-day gap since last release

Package facts

License not declared (unclear)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 250 days since the last release
Last repo commit
First released
Downloads 505,326/month — #6,292 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: delayed_assert-0.4.2-py3-none-any.whl

Tags

soft assertions pythondelayed assertions testingcollect multiple test failuresnon-stopping assertionsassertion batchingtest failure aggregationcontinue after assertion fails
testing-utilitiesassertion-helpers

More Testing packages