Skip to main content

cot-assert

Assertion rewriting that raises a structured AnnotatedAssertion, for Python 2.7, Python 3.9+ and RPython. Intended as a drop-in replacement for pytest's assertion rewriting on current pytest and on pytest 4.6.

Pre-alpha.

pip install cot-assert

One universal wheel serves Python 2.7 (pip 20 and later, CPython or PyPy) and Python 3.9 and later. It has no dependencies.

With pytest

Installing the package registers a pytest plugin that stays off until enabled:

[pytest]
cot_assert = true
# where a failed assert's explanation goes: message (default) or notes
cot_assert_finalize = message

or pytest --cot-assert. On Python 2.7, where it runs from source, load it with -p cot_assert.pytest_plugin.

cot_assert replaces pytest's import hook. It rewrites the modules pytest would (test files by python_files, conftests, files named on the command line, pytest.register_assert_rewrite) and caches them like the standalone hook below, under a name of its own. Failures render through pytest's own comparison hooks and show as AnnotatedAssertion instead of AssertionError. --assert=plain turns rewriting off for both.

Without pytest

import cot_assert

cot_assert.install(["mypackage", "test_*"])

rewrites modules imported afterwards whose name matches.

Metadata

Release files for cot-assert 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cot-assert 0.3.0
File Size Uploaded Provenance Actions
cot_assert-0.3.0.tar.gz 61.2 kB With provenance Details for cot_assert-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cot-assert 0.3.0
File Interpreter ABI Platform Actions
cot_assert-0.3.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for cot_assert-0.3.0-py2.py3-none-any.whl

Total release size: 94.1 kB

Release files / cot_assert-0.3.0.tar.gz

Download URL cot_assert-0.3.0.tar.gz
Size 61.2 kB
Tags Source
SHA-256 checksum
How to use checksums
85903af5b4f50cb50e9658dfb6db36c8791c8cddaaf354b1d124839456dc8f2c
BLAKE2b-256 checksum
How to use checksums
c13c4d789813f8007a8b368c393289848c2e6ff07d364a42051568ca7fa88b43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / cot_assert-0.3.0-py2.py3-none-any.whl

Download URL cot_assert-0.3.0-py2.py3-none-any.whl
Size 32.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
608eb85eb0156dc05b2bcc49a5decf0a812797b33bb04d7316e0605e4487410b
BLAKE2b-256 checksum
How to use checksums
28af92262fd5aa089d8ecd21d4fd114630d2a2be65db26412e77b46d80b08724
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Security for cot-assert 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cot_assert-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page