Allow assertThrows
to handle any Throwable
(including AssertionsError
#161
Labels
enhancement
New feature or request
Currently, the
assertThrows
method is constrained to handle only instances ofException
. This limits its ability to catchThrowable
instances such asAssertionsError
, which is anError
and not anException
.Proposed Change:
Update the generic type signature of
assertThrows
from:to
The change ensures that assertThrows can handle all types of Throwable, including both Exception and Error types (e.g., AssertionsError).
This also makes the method more flexible and robust, allowing for broader use cases where errors may be thrown during assertions.
The text was updated successfully, but these errors were encountered: