You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently built a test that intentionally causes an exception and capture that exception using the expectException function. I did not realize that after the exception is thrown the test is ended even if their are additional assert statements after the exception.
It took nearly an hour to figure out why my asserts were not being seen. I had to find the answer from some outdated forum that on exception the test ends. This is not listed in the official documentation. This is also very poor usability.
At the lest the documentation needs to be updated.
Better would be to remove function and force users to try/catch the exception on their own so they don't fall into the trap I did. Or best find a way for the function to capture exception and continue the test.
The text was updated successfully, but these errors were encountered:
You are right, we have to improve the functionality and usability.
Or best find a way for the function to capture exception and continue the test.
The expectException function should capture the expected exception, but not end or exit. Maybe the function should return a boolean return value to allow assertException() or assertTrue()/assertFalse().
Thank you for reporting this issue and sorry for the inconvenience.
I recently built a test that intentionally causes an exception and capture that exception using the
expectException
function. I did not realize that after the exception is thrown the test is ended even if their are additional assert statements after the exception.It took nearly an hour to figure out why my asserts were not being seen. I had to find the answer from some outdated forum that on exception the test ends. This is not listed in the official documentation. This is also very poor usability.
At the lest the documentation needs to be updated.
Better would be to remove function and force users to try/catch the exception on their own so they don't fall into the trap I did. Or best find a way for the function to capture exception and continue the test.
The text was updated successfully, but these errors were encountered: