-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixtures: Modularize fixtures creating AiiDA test instance and profile (
#5758) The `aiida_profile` is a fixture that will automatically load an existing test profile, if specified by the `AIIDA_TEST_PROFILE` environment variable, or otherwise create a temporary and isolated test profile from scratch. While very useful to make it easy to start writing tests against an AiiDA instance, it hard-coded most if not all of the configuration. For example, the storage backend was hardcoded to the `core.psql_dos` storage backend. This used to be fine since this was the only storage backend available, but since `aiida-core==2.1` they are pluginnable and so it becomes necessary to be able to configure them. The `aiida_profile` still works the same as in that it automatically provides a fully loaded AiiDA test instance, and it still loads the `core.psql_dos` storage by default, but it does so through the new `aiida_profile_factory` fixture. This fixture can be reused in plugin packages to achieve the same effect, but they can override any setting of the profile configuration by providing those through the `custom_configuration` argument. These new fixtures make the `aiida.manage.tests.main` module obsolete. It was added when the tests were still run with the `unittest` module instead of `pytest`. The module is deprecated as all of its functionality is completely provided by the new, more modular and more succinct pytest fixtures.
- Loading branch information
Showing
8 changed files
with
442 additions
and
49 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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.