A python package to print pretty, user-friendly assertions.
Project description
pretty_assert
English | 简体中文
Prints pretty, user friendly assert messages.
Features
- Do not print traces that confuse the user
- Add Comment
- Customize colors and other options
assert_eq
enhancement with icdiff
Installation
pip install pretty-assert
Usage
from pretty_assert import (
init,
assert_,
assert_eq,
assert_ge,
assert_gt,
assert_in,
assert_le,
assert_lt,
assert_ne,
assert_not_in,
)
some_bool = True
some_number = 1
assert_(some_bool) # you can assert without comment
assert_(some_bool, "some_bool is not True")
assert_eq(some_number, 1, "some_number is not 1")
...
For more usage and customization, please check out examples.
Thanks
- assert2: inspired by
- pytest-icdiff: code reference
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pretty_assert-0.1.0.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for pretty_assert-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e57c32b154f21fb0fa175c1ac8669ceb8e515a906b4587c2abda6390ee5116d |
|
MD5 | 522a2b96492fb091ddc95394cbeabdf9 |
|
BLAKE2b-256 | 6eb184ffbf853840f423655a07634f2c76846c9975806217233cc75c9d6ec1b2 |