-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify AiidaTestCase implementation (#4779)
This simplifies the `AiidaTestCase` implementation - not yet replacing it with pytest fixtures, but hopefully getting one step closer to doing so eventually. In particular * only truly backend-specific code is left in the backend-specific test classes * introduces `refurbish_db()` which includes the combination of cleaning the db and repopulating it with a user (which is a common combination) * move creation of default computer from `setUpClass` to "on demand" (not needed by many tests) * merges `reset_database` and `clean_db` function that basically did the same * factors out the `get_default_user` function so that it can be reused outside the AiidaTestCase (`verdi setup`, pytest fixtures, ...) in a follow-up PR * add `orm.Computer.objects.get_or_create` (in analogy to similar methods for user, group, ...) Note: While this change gets rid of unnecessary complexity, it does *not* switch to a mode where the database is cleaned between *every* test. While some subclasses of `AiidaTestCase` do this, the `AiidaTestCase` itself only cleans the database in `setupClass`. Some subclasses do significant test setup at the class level, which might slow things down if they had to be done for every test.
- Loading branch information
Showing
29 changed files
with
194 additions
and
343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.