For example:
with soft_assertions():
assert_that([1,2,3]).contains(3,4,5)
Outputs this:
soft assertion failures:
1. Expected <[1, 2, 3]> to contain items (3, 4, 5), but did not contain <4>.
2. Expected <[1, 2, 3]> to contain items (3, 4, 5), but did not contain <5>.
Outside the soft_assertions() context, the loop is short circuited by throwing an AssertionError, but inside all assertions are rolled up until the context is closed.
For example:
Outputs this:
Outside the
soft_assertions()context, the loop is short circuited by throwing anAssertionError, but inside all assertions are rolled up until the context is closed.