Skip to main content

Build Status

Asserty

Asserty is a utility package that provides methods for better assertion in testing.

Installation

The package can be installed using pip:

$ pip install asserty

Examples

You make assertions by importing the assert_that function from the asserty package:

from asserty import assert_that

assert_that("str").not_equals("string")
assert_that(5).is_in(range(10))

def myfunc(arg):
    if not isinstance(arg, str):
        raise TypeError()
    return arg+"yay"

assert_that(myfunc).if_called_with(1).raises(TypeError)
assert_that(myfunc).if_called_with("Hey-").returns("Hey-yay")

Outside a test context that does not handle AssertionError you can import the equivalent function called that:

from asserty import that

assert that("str").not_equals("string")
assert that(5).is_in(range(10))

Metadata

Release files for asserty 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asserty 3.0.0
File Size Uploaded
asserty-3.0.0.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for asserty 3.0.0
File Interpreter ABI Platform
asserty-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.7 kB

Release files / asserty-3.0.0.tar.gz

Download URL asserty-3.0.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e357c854db41b7e3adfededc9c8c03754d22d4723d92c4e5119c378dfae7b19a
BLAKE2b-256 checksum
How to use checksums
3e695efb818c5b787a5686cc20d47c5f47b6a6ab1819f3d14c5118d93475766f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release files / asserty-3.0.0-py3-none-any.whl

Download URL asserty-3.0.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f90cebed0e93f537683050938f1b046832f6158b5af2f0d5fa7f611af583725
BLAKE2b-256 checksum
How to use checksums
10e87e25b9615af8e6641a4bc338fe440ac14775989e22c14a89b06f775fce6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page