-
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
Tests: Fixture implementation duplicated between deprecated manage/tests/pytest_fixtures.py
and tools/pytest_fixtures/
#6612
Comments
manage/tests/pytest_fixtures.py
and tools.pytest_fixtures
manage/tests/pytest_fixtures.py
and tools/pytest_fixtures/
I totally agree. I think the doc page https://aiida.readthedocs.io/projects/aiida-core/en/stable/topics/plugins.html#plugin-test-fixtures Is very helpful to show what fixtures that plugin developers can use. We may also want to add same paper for public APIs. |
I honestly don't know if it is worth the churn to be refactoring deprecated functions. I think it is easier to let them be and eventually remove them, and only do new development in the new ones. |
I guess the problem @GeigerJ2 and @khsrali had today was they made changes to new fixtures and then found changes need to apply to the deprecated one as well, correct me if I am wrong. |
We don't have a consistent way to do it over the modules but in this case |
Yeah, I agree, that's why I only made the issue so far, not a PR :D Though, it should be quite quick. Just remove the source code there and import from the more recent modules instead.
Not really changing anything, but I wanted to look at the fixture implementation, and global search in VS Code yielded two definitions, which confused me. |
Regardless of a definition of a public API, these fixtures are widely used in the AiiDA ecosystem, so we shouldn't remove them just yet IMO, not until a few releases. The new fixtures were only introduced in v2.6 so it'll be a while until everybody catches up. |
👍 😄
To clarify, my main concern was not really about the time to implement it, but the fact that you would be introducing coupling between the |
For instance,
aiida_localhost
inmanage/tests/pytest_fixtures.py
:aiida-core/src/aiida/manage/tests/pytest_fixtures.py
Lines 657 to 668 in dd866ce
and in
tools/pytest_fixtures/orm.py
:aiida-core/src/aiida/tools/pytest_fixtures/orm.py
Lines 193 to 204 in dd866ce
with
manage/tests/pytest_fixtures.py
being deprecated:aiida-core/src/aiida/manage/tests/pytest_fixtures.py
Lines 54 to 57 in dd866ce
Of course, we still need to keep access from the old module for now for backwards compatibility, otherwise plugins break, e.g.:
https://github.com/aiidateam/aiida-quantumespresso/blob/57e7463c5727775d6a0470a41d1aca0ec4083b9a/tests/conftest.py#L13
But rather than duplicating the source code as it seems to be done now, we should let the fixtures in
manage/tests/pytest_fixtures.py
call the actual implementation intools/pytest_fixtures/orm.py
. Pinging theaiida-core
office @agoscinski, @unkcpz, @khsrali.The text was updated successfully, but these errors were encountered: