Skip to main content

Assertion library for python unit testing with a fluent API

Project description

Dead simple assertion library for python unit testing with a fluent API that supports 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
assertpy-0.14.tar.gz (12.8 kB) Copy SHA256 hash SHA256 Source None Sep 16, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page