Metadata-Version: 2.4
Name: testsweet
Version: 0.1.5
Summary: Python testing for humans
Project-URL: Homepage, https://github.com/kaapstorm/testsweet
Project-URL: Source, https://github.com/kaapstorm/testsweet
Project-URL: Documentation, https://github.com/kaapstorm/testsweet/blob/main/README.md
Project-URL: Changelog, https://github.com/kaapstorm/testsweet/blob/main/CHANGELOG.md
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.11
Description-Content-Type: text/markdown

<img src="https://raw.githubusercontent.com/kaapstorm/testsweet/refs/heads/main/docs/img/testsweet_200x200.png" width="120" align="right" alt="Testsweet logo">

Testsweet
=========

Python testing for humans


Why?
----

Neither of the two most popular libraries for testing in Python,
[unittest](https://docs.python.org/3/library/unittest.html) and
[pytest](https://docs.pytest.org/), 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](https://docs.pytest.org/en/stable/how-to/fixtures.html)
work is magical, especially when they are imported
[invisibly](https://docs.pytest.org/en/stable/how-to/writing_plugins.html#localplugin).
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:

```python
from testsweet import test


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

A test class:

```python
from testsweet import test


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

Running tests:

```shell
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
-------------

* [Getting Started](https://github.com/kaapstorm/testsweet/blob/main/docs/getting-started.md)
* [Reference](https://github.com/kaapstorm/testsweet/blob/main/docs/reference.md)
* [Contributing](https://github.com/kaapstorm/testsweet/blob/main/docs/contributing.md)
