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.1.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file pretty_assert-0.1.1.tar.gz
.
File metadata
- Download URL: pretty_assert-0.1.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.2 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f320c72591f61777b85defdcb1e7fa00ceb4dfaa456545d68bf533d9bc84d81d |
|
MD5 | 852697fc5833a119e08e4335d8fbdcd2 |
|
BLAKE2b-256 | 1e8f21e118c3eeaa82ba59757072697ea5536a1312c8b7054d68ae411c81ed42 |
File details
Details for the file pretty_assert-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: pretty_assert-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.2 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 457008a6132edb9df763614ccabede8fe02c4f02c51d536784aa633a15e54ce1 |
|
MD5 | d6a6bd111eb54690ed407afc2d172133 |
|
BLAKE2b-256 | 8ad0257574e4f05889ea19fa0293f94712784a7626804ffe390524691e88d0cd |