Skip to content

verbose failure messages under soft assertions #68

Description

@saturnboy

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions