Migration from aiida.manage.tests.pytest_fixtures to aiida.tools.pytest_fixtures

Thank you for your continuous development of AiiDA.

Is there a guideline available for migrating from aiida.manage.tests.pytest_fixtures to aiida.tools.pytest_fixtures for writing tests for plugins? I am considering this migration for aiida-vasp.

I apologize if this information is already documented elsewhere.

Hi Togo, there is no extensive migration documentation since that should be relatively straightforward. The main step is to replace the import

pytest_plugins = 'aiida.manage.tests.pytest_fixtures

to the new location

pytest_plugins = 'aiida.tools.pytest_fixtures

Then it depends on what other fixtures you were using. As mentioned in the documentation most older fixtures have drop in replacements but there are some changes that are, unfortunately, not listed exhaustively somewhere. I would simply recommend to look at the documentation of the current fixtures to see what they are called now and how to use them, I think it should be relatively straightforward to adapt. Otherwise feel free to come back here with questions.

https://aiida.readthedocs.io/projects/aiida-core/en/v2.6.0/topics/plugins.html#plugin-test-fixtures

1 Like

Thanks @sphuber for your prompt reply. In aiida-vasp, I found aiida_caplog in the aiida-vasp tests. Is there any alternative? Maybe I am asking a stupid question because I am not familiar with logging. I even don’t know if the existing aiida_caplog is necessary for the aiida-vasp tests or not.

I think this fixture was obsolete and so we removed it. You can try just replacing it with the built-in caplog that is provided by pytest itself

1 Like