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.

pytest still decides which modules are rewritten (test files, conftests, pytest.register_assert_rewrite) and caches them under a separate name; cot_assert does the rewriting, and failures render through pytest's own comparison hooks. Failures 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.1.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.1.0
File Size Uploaded
cot_assert-0.1.0.tar.gz 45.7 kB Details

Built distribution (wheel)

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

Total release size: 73.4 kB

Release files / cot_assert-0.1.0.tar.gz

Download URL cot_assert-0.1.0.tar.gz
Size 45.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8863072a00e3394be589e5de81b96c43b13fcb40304e89eb0fcf7a4e13f82b09
BLAKE2b-256 checksum
How to use checksums
697f44882a1195fddb65b115a7ccff37d8f780d132037ab8df86879ae4bc2f70
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 Sep 24, 2026.

Transparency log

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

Download URL cot_assert-0.1.0-py2.py3-none-any.whl
Size 27.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1f876615b5a659bfb1fc43a946c232613f7f2abd591278208ae8bf08a6224be2
BLAKE2b-256 checksum
How to use checksums
c83295ea25f2a7ab9770e08b65e99b7f111a3097968a29b9f5684a843be36557
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 Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

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