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.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cot_assert-0.4.0.tar.gz | 83.7 kB | With provenance | Details for cot_assert-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cot_assert-0.4.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for cot_assert-0.4.0-py2.py3-none-any.whl |
Total release size: 115.2 kB
Release files / cot_assert-0.4.0.tar.gz
| Download URL | cot_assert-0.4.0.tar.gz |
|---|---|
| Size | 83.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a8a36b9b4c33229692d550a05dffc67174828e1f9099706bf6eb4493d27988b4
|
|
BLAKE2b-256 checksum How to use checksums |
daab9f6f0ffc11defe180155987762fe30589ffdfd72c4be3974d09aadd1ab20
|
| 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 8, 2026.
Transparency logRelease files / cot_assert-0.4.0-py2.py3-none-any.whl
| Download URL | cot_assert-0.4.0-py2.py3-none-any.whl |
|---|---|
| Size | 31.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
d96c481ece6eb2edd166805c4c3a34bd900185eb7ee05723027090bd5cb0ecbb
|
|
BLAKE2b-256 checksum How to use checksums |
c5bf7830715136f07eeb0ae7092bad501b3074e936794c81f328f4a216feacc0
|
| 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 8, 2026.
Transparency logSecurity for cot-assert 0.4.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.
Attestation for cot_assert-0.4.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 8, 2026.
Transparency logA 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.