A straightforward assertion library for Python.
Ranked in these QuestionsQuestion Ranking
Pro API is straightforward
There is only one function to import to use assertpy:
assert_that(). Assertions are made by passing values as function parameters to the appropriate function(s), e.g.
Pro Compact and Pythonic
Assertions are made through simple Python function calls with idiomatic names.
Pro Supports asserting values beyond normal data types
assertpy has support for asserting values such as datetimes (e.g.
assert_that(x).has_year(1980)), files (e.g.
assert_that('foo.txt').exists()), and objects.