Asserts that actual value satisfies matcher. (Can also assert plain boolean condition.)
assert_that passes the actual value to the matcher for evaluation. If the matcher is not satisfied, an exception is thrown describing the mismatch.
assert_that is designed to integrate well with PyUnit and other unit testing frameworks. The exception raised for an unmet assertion is an AssertionError, which PyUnit reports as a test failure.
With a different set of parameters, assert_that can also verify a boolean condition:
Wraps a matcher to define equality in terms of satisfying the matcher.
match_equality allows Hamcrest matchers to be used in libraries that are not Hamcrest-aware. They might use the equality operator:
assert match_equality(matcher) == object
Or they might provide a method that uses equality for its test:
One concrete example is integrating with the assert_called_with methods in Michael Foord’s mock library.