Skip to content

Improve context information of Assertions2.call(...) #162

@zentox

Description

@zentox

When Assertions2.call(...) is used to verify that a test case does not throw an exception but actually does, the failure output is not informative. The current output looks like this:

org.opentest4j.AssertionFailedError: ...
context = {

}
Expected :null
Actual   :null

This does not clearly convey the issue, making debugging harder.

Prposed changes:

Update the failure message to provide meaningful information:

  • Expected: No exception thrown
  • Actual: The actual exception that was thrown, including its type and message

Example of Desired Output

org.opentest4j.AssertionFailedError: ...
context = {

}
Expected : No exception thrown
Actual   : java.lang.IllegalArgumentException: Invalid argument

This would make debugging easier by clearly indicating what went wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions