Inspectopedia
 
2024.3

Assertion is suppressed by 'catch'

Warning
New
Last modified: 03 December 2024

Reports assert statements and test framework assertions that are suppressed by a surrounding catch block. Such assertions will never fail, as the thrown AssertionError will be caught and silently ignored.

Example 1:

Example 2:

Example 3:

New in 2020.3