Name | pretty-assert JSON |
Version |
0.1.1
JSON |
| download |
home_page | None |
Summary | A python package to print pretty, user-friendly assertions. |
upload_time | 2024-06-14 03:58:21 |
maintainer | None |
docs_url | None |
author | lxl66566 |
requires_python | <4.0,>=3.8 |
license | MIT |
keywords |
assertion
pretty
user
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# pretty_assert
English | [简体中文](./README.zh-CN.md)
Prints pretty, **user friendly** assert messages.
![ex](./static/eq_example.png)
## Features
- Do not print traces that confuse the user
- Add Comment
- Customize colors and other options
- `assert_eq` enhancement with icdiff
## Installation
```sh
pip install pretty-assert
```
## Usage
```python
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](./examples/).
## Thanks
- [assert2](https://crates.io/crates/assert2): inspired by
- [pytest-icdiff](https://github.com/hjwp/pytest-icdiff): code reference
Raw data
{
"_id": null,
"home_page": null,
"name": "pretty-assert",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "assertion, pretty, user",
"author": "lxl66566",
"author_email": "lxl66566@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/1e/8f/21e118c3eeaa82ba59757072697ea5536a1312c8b7054d68ae411c81ed42/pretty_assert-0.1.1.tar.gz",
"platform": null,
"description": "# pretty_assert\n\nEnglish | [\u7b80\u4f53\u4e2d\u6587](./README.zh-CN.md)\n\nPrints pretty, **user friendly** assert messages.\n\n![ex](./static/eq_example.png)\n\n## Features\n\n- Do not print traces that confuse the user\n- Add Comment\n- Customize colors and other options\n- `assert_eq` enhancement with icdiff\n\n## Installation\n\n```sh\npip install pretty-assert\n```\n\n## Usage\n\n```python\nfrom pretty_assert import (\n init,\n assert_,\n assert_eq,\n assert_ge,\n assert_gt,\n assert_in,\n assert_le,\n assert_lt,\n assert_ne,\n assert_not_in,\n)\nsome_bool = True\nsome_number = 1\nassert_(some_bool) # you can assert without comment\nassert_(some_bool, \"some_bool is not True\")\nassert_eq(some_number, 1, \"some_number is not 1\")\n...\n```\n\nFor more usage and customization, please check out [examples](./examples/).\n\n## Thanks\n\n- [assert2](https://crates.io/crates/assert2): inspired by\n- [pytest-icdiff](https://github.com/hjwp/pytest-icdiff): code reference\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A python package to print pretty, user-friendly assertions.",
"version": "0.1.1",
"project_urls": null,
"split_keywords": [
"assertion",
" pretty",
" user"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8ad0257574e4f05889ea19fa0293f94712784a7626804ffe390524691e88d0cd",
"md5": "d6a6bd111eb54690ed407afc2d172133",
"sha256": "457008a6132edb9df763614ccabede8fe02c4f02c51d536784aa633a15e54ce1"
},
"downloads": -1,
"filename": "pretty_assert-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d6a6bd111eb54690ed407afc2d172133",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 4824,
"upload_time": "2024-06-14T03:58:19",
"upload_time_iso_8601": "2024-06-14T03:58:19.743806Z",
"url": "https://files.pythonhosted.org/packages/8a/d0/257574e4f05889ea19fa0293f94712784a7626804ffe390524691e88d0cd/pretty_assert-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1e8f21e118c3eeaa82ba59757072697ea5536a1312c8b7054d68ae411c81ed42",
"md5": "852697fc5833a119e08e4335d8fbdcd2",
"sha256": "f320c72591f61777b85defdcb1e7fa00ceb4dfaa456545d68bf533d9bc84d81d"
},
"downloads": -1,
"filename": "pretty_assert-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "852697fc5833a119e08e4335d8fbdcd2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 4502,
"upload_time": "2024-06-14T03:58:21",
"upload_time_iso_8601": "2024-06-14T03:58:21.333192Z",
"url": "https://files.pythonhosted.org/packages/1e/8f/21e118c3eeaa82ba59757072697ea5536a1312c8b7054d68ae411c81ed42/pretty_assert-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-14 03:58:21",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pretty-assert"
}