Metadata-Version: 2.5
Name: cot-assert
Version: 0.2.0
Summary: assertion rewriting with a structured AssertionError, for Python 2.7, 3.x and RPython
Author-email: Ronny Pfannschmidt <opensource@ronnypfannschmidt.de>
License-Expression: MPL-2.0
License-File: LICENSE
Keywords: assert,pytest,rpython
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
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.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,>=2.7
Description-Content-Type: text/markdown

# 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:

```ini
[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

```python
import cot_assert

cot_assert.install(["mypackage", "test_*"])
```

rewrites modules imported afterwards whose name matches.
