Overview
Dessert is a utility library enabling Python code to introspect assertions raised via the assert statement.
It is a standalone version of the introspection code from pytest, and all credit is due to Holger Krekel and the pytest developers for this code.
Usage
Using dessert is fairly simple:
>>> with open(tmp_filename, "w") as f:
... _ = f.write("""
... def func():
... def x():
... return 1
... def y():
... return -1
... assert y() == x()
... """)
>>> import emport
>>> import dessert
>>> with dessert.rewrite_assertions_context():
... module = emport.import_file(tmp_filename)
>>> module.func() # doctest: +IGNORE_EXCEPTION_DETAIL +ELLIPSIS
Traceback (most recent call last):
...
assert y() == x()
AssertionError: assert -1 == 1
+ where -1 = <function y at ...>()
+ and 1 = <function x at ...>()
Licence
Dessert is released under the MIT license. It is 99% based on pytest, which is released under the MIT license.
Release files for dessert 1.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dessert-1.6.3.tar.gz | 23.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dessert-1.6.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.2 kB
Release files / dessert-1.6.3.tar.gz
| Download URL | dessert-1.6.3.tar.gz |
|---|---|
| Size | 23.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3113bd5bca112e99a968dcf74afe8841c4e370a936ebeec61b8d9dfb91b8ef6
|
|
BLAKE2b-256 checksum How to use checksums |
ea58d3e1f91d91e180b567c4cb9bf5a1208c1432b85a9abd8a8de91cae52633c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Nov 24, 2025.
Transparency logRelease files / dessert-1.6.3-py3-none-any.whl
| Download URL | dessert-1.6.3-py3-none-any.whl |
|---|---|
| Size | 21.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
512a32e3f19235a117c49ccf27b86f49a90a527320e4ba7fa99f23de45307151
|
|
BLAKE2b-256 checksum How to use checksums |
6fd4d9476deed63bd421976ea5466a00c7ee0dbf342ea7283a3357fa08c620b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Nov 24, 2025.
Transparency log