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

No error assertions in NoMAD unit tests #43

Closed
samuong opened this issue Dec 22, 2019 · 2 comments
Closed

No error assertions in NoMAD unit tests #43

samuong opened this issue Dec 22, 2019 · 2 comments

Comments

@samuong
Copy link
Owner

samuong commented Dec 22, 2019

Prior to #41, some of the unit tests for NoMAD integration contained assertions on the message within an error. With these removed, the tests just check for the presence of an error, without checking what type.

This should be changed to check the error type, using the new errors.As function, introduced in Go 1.13.

Additional context can be found in the comments of #41.

@camh-
Copy link
Collaborator

camh- commented Dec 22, 2019

I would only do this if the error result is part of a stable API. It is sufficient to check that the function under test returns an error under error conditions. If the function is not documented to return a particular type of error, testing for that just makes the tests more fragile.

@samuong
Copy link
Owner Author

samuong commented Jan 19, 2020

Ok that's a fair point, this is definitely not a documented API. Julia didn't seem to have a super strong opinion on this either, so I'll close this issue and we can leave the error type assertions out.

@samuong samuong closed this as completed Jan 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants