Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExpectException Needs better documentation #33

Open
danielson317 opened this issue Sep 13, 2016 · 1 comment
Open

ExpectException Needs better documentation #33

danielson317 opened this issue Sep 13, 2016 · 1 comment

Comments

@danielson317
Copy link

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.

@jakoch
Copy link
Member

jakoch commented Sep 13, 2016

Hey Daniel!

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants