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)
| File | Size | Uploaded | |
|---|---|---|---|
| asserty-3.0.0.tar.gz | 6.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|