Skip to main content

A python package to print pretty, user-friendly assertions.

Project description

pretty_assert

English | 简体中文

Prints pretty, user friendly assert messages.

ex

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

Project details


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 hashes)

Uploaded Source

Built Distribution

pretty_assert-0.1.1-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page