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

Fix No Teardown on Failed Create Data Tests #201

Closed
2 tasks
MRichards99 opened this issue Jan 21, 2021 · 0 comments · Fixed by #202
Closed
2 tasks

Fix No Teardown on Failed Create Data Tests #201

MRichards99 opened this issue Jan 21, 2021 · 0 comments · Fixed by #202
Assignees
Labels
bug Something isn't working

Comments

@MRichards99
Copy link
Collaborator

Description:
On the ICAT backend, if any of the tests prefixed with test_valid in test_create_icat.py fail, the data that gets created from those tests won't get removed, thereby not leaving icatdb into a clean state once the tests have finished running. This happens because the data is removed at the end of the test function (after the assert statement) so any code after that won't run if it throws an AssertionError.

Acceptance criteria:

  • All tests should still pass
  • If any tests in test_create_icat.py with the test_valid prefix are provoked to fail, the investigations table on icatdb should still be in the same state that it started. This can be indirectly checked through the other tests - if it hasn't been fixed, there'll be lots of other test failures where investigation data is involved
@MRichards99 MRichards99 added the bug Something isn't working label Jan 21, 2021
@MRichards99 MRichards99 self-assigned this Jan 21, 2021
MRichards99 added a commit that referenced this issue Jan 22, 2021
- This replaces the data deletion loop that was after the assert statement, which wouldn't run if the an AssertionError was raised, resulting in undeleted test data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant