-
Notifications
You must be signed in to change notification settings - Fork 191
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
pytest fixtures provided by aiida-core - what more should be included? #3473
Comments
Another thing I had forgot to mention: It would be great to print the I think |
FYI the |
This might require that we define the |
Haven't yet seen a use case for this, so not at the moment. |
Yes, so we should probably make something like a |
Also, if there is a feature to test This is rather clean and easy. However, gives some problems during development when tracking down where things fail (the combination of commands in shell/script and quite a lot of files makes this a bit hard to track). In particular it gets a bit nasty when we for instance want to test something like a k-point convergence |
In order to reintroduce the My vote going forward is to open for passing options to |
This is now hopefully less pressing now that the new fixtures in |
aiida-core 1.0 now ships with a number of fixtures for running tests, but there is clearly room for improvement.
We should decide which of the following features should also be included:
fixtures by @sphuber in aiida-qe:
CalcJob
classes. Example usage can be found here forPwCalculation
.Parser
implementations. It essentially mocks a completedCalcJobNode
with theretrieved
folder data node that contains the retrieved files. Example usage forPwParser
shows.The automatic comparison files generation and checking is done through the
pytest-regressions
plugin which is added as a dependency. With this pytest plugin and the two fixtures, it is really easy to write and run tests for calculation jobs and parsers without actually having to run the calculations. Note of course, as mentioned before, that some tests that actually run the code will still be useful and desirable.pointers from @greschd concerning aiida-pytest:
On the actual machine I would rename this to ‘config.yml’ (which is in .gitignore), and make the necessary changes.
One thing that I’ve found to be helpful is having an option to wait for user input before wiping the test DB. That allows for inspecting the state better before it’s gone. See here: https://github.com/greschd/aiida_pytest/blob/migrate_v1/aiida_pytest/_configure.py#L152
Regarding the current fixtures in aiida-core:
aiida_profile._manager.root_dir
?The text was updated successfully, but these errors were encountered: