Simple assertion library for unit testing in python with a fluent API
Project Links
Meta
Author: Justin Shacklette
Classifiers
Development Status
- 5 - Production/Stable
Intended Audience
- Developers
License
- OSI Approved :: BSD License
Natural Language
- English
Operating System
- OS Independent
Programming Language
- Python
- Python :: 2
- Python :: 2.7
- Python :: 3
- Python :: 3.4
- Python :: 3.5
- Python :: 3.6
- Python :: 3.7
- Python :: 3.8
Topic
- Software Development
- Software Development :: Testing
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
Jul 19, 2020
1.1
Dec 14, 2019
1.0
Oct 30, 2019
0.15
Sep 16, 2018
0.14
Jan 27, 2018
0.13
Nov 20, 2017
0.12
Aug 28, 2017
0.11
Jul 31, 2016
0.10
Mar 23, 2016
0.9
May 11, 2015
0.8
Apr 20, 2015
0.7
Feb 02, 2015
0.6
Feb 01, 2015
0.5
Files in release
No dependencies