Simple assertions library for unit testing in Python with a nice fluent API. Supports both Python 2 and 3.
Usage
Just import the assert_that function, and away you go…:
from assertpy import assert_that
def test_something():
assert_that(1 + 2).is_equal_to(3)
assert_that('foobar').is_length(6).starts_with('foo').ends_with('bar')
assert_that(['a', 'b', 'c']).contains('a').does_not_contain('x')
Of course, assertpy works best with a python test runner like pytest (our favorite) or Nose.
Install
The assertpy library is available via PyPI. Just install with:
pip install assertpy
Or, if you are a big fan of conda like we are, there is an assertpy-feedstock for Conda-Forge that you can use:
conda install assertpy --channel conda-forge
Metadata
Release files for assertpy 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| assertpy-1.1.tar.gz | 25.4 kB | Without provenance | Details |
Release files / assertpy-1.1.tar.gz
| Download URL | assertpy-1.1.tar.gz |
|---|---|
| Size | 25.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
acc64329934ad71a3221de185517a43af33e373bb44dc05b5a9b174394ef4833
|
|
BLAKE2b-256 checksum How to use checksums |
4f39720b5d4463612a40a166d00999cbb715fce3edaf08a9a7588ba5985699ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.1
|
Security for assertpy 1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.