Skip to main content
Testsweet logo

Testsweet

Python testing for humans

Why?

Neither of the two most popular libraries for testing in Python, unittest and pytest, make it over the hurdle of the Zen of Python.

Beautiful is better than ugly.
Explicit is better than implicit.

unittest is modeled closely on JUnit and the xUnit family of libraries. Its strength is its familiarity to people who are accustomed to them. Its weakness is its failure to take advantage of existing Python idioms and conventions. It's not beautiful.

Pytest addresses a lot of the shortcomings of unittest, but the way that its fixtures work is magical, especially when they are imported invisibly. It doesn't make it past the second line of the Zen of Python.

Testsweet intends to be a Python testing library that uses existing Python features and idioms: A kind and simple interface, explicit in its architecture, enabling the tests that use it to be beautiful.

Examples

A test function:

from testsweet import test


@test
def or_dicts():
    assert {'foo': 1} | {'bar': 2} == {'foo': 1, 'bar': 2}

A test class:

from testsweet import test


@test
class OrThings:
    def or_dicts(self):
        assert {'foo': 1} | {'bar': 2} == {'foo': 1, 'bar': 2}

Running tests:

testsweet tests.test_module.TestClass.test_method
testsweet tests/test_module.py
testsweet  # Discover tests

python -m testsweet ... works equivalently and is useful when the console script is not on PATH.

Documentation

Metadata

Release files for testsweet 0.2.3

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

Source distribution (sdist)

Source distribution for testsweet 0.2.3
File Size Uploaded Provenance Actions
testsweet-0.2.3.tar.gz 103.3 kB With provenance Details for testsweet-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for testsweet 0.2.3
File Interpreter ABI Platform Actions
testsweet-0.2.3-py3-none-any.whl Python 3 none any Details for testsweet-0.2.3-py3-none-any.whl

Total release size: 133.8 kB

Release files / testsweet-0.2.3.tar.gz

Download URL testsweet-0.2.3.tar.gz
Size 103.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0d1f1a857e20ae382ea4c2b62f916ea69c37ea1138048db2ec52dc502dad6934
BLAKE2b-256 checksum
How to use checksums
5f52a87343f10ce49759c1ae8b3ade7db65e0e85d2c05d25008f30f715c4cfed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 28, 2026.

Transparency log

Release files / testsweet-0.2.3-py3-none-any.whl

Download URL testsweet-0.2.3-py3-none-any.whl
Size 30.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1417e00d00880cfd2735cd40e158f237d975b34d331f77f9bdfe2c0e41ea0f2
BLAKE2b-256 checksum
How to use checksums
8a8b45be3e842cdd87a381a0f3d4ce9859888513167c579fd05dbeac26e31512
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 28, 2026.

Transparency log

Security for testsweet 0.2.3

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for testsweet-0.2.3.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 Jun 28, 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