Skip to content

♻️ Fix tests#190

Merged
mbercx merged 2 commits intomainfrom
tests/empty-config
Jul 1, 2025
Merged

♻️ Fix tests#190
mbercx merged 2 commits intomainfrom
tests/empty-config

Conversation

@mbercx
Copy link
Copy Markdown
Member

@mbercx mbercx commented Jun 30, 2025

The empty_config context manager is used for some of the testing infrastructure of the installation commands. It relied on some methods for adapting the AiiDA configuration folder, whose API has been changed in

aiidateam/aiida-core@9baf3ca

Here we adapt the empty_config context manager to rely on the new API using the AiiDAConfigDir.

mbercx added 2 commits July 1, 2025 09:48
The `empty_config` context manager is used for some of the testing infrastructure
of the installation commands. It relied on some methods for adapting the
AiiDA configuration folder, whose API has been changed in

aiidateam/aiida-core@9baf3ca

Here we adapt the context manager to rely on the new API using the `AiiDAConfigDir`.
The `test_constructor_invalid` test in the `data/pseudo/test_pseudo.py` module was
testing that the `PseudoPotentialData` constructor would fail with no input arguments.
This behaviour was the expected behavior of the parent `SinglefileData` class, from
which `PseudoPotentialData` inherits its constructor. However, the `SinglefileData`
constructor now accepts no input arguments since the changes in:

aiidateam/aiida-core@958bfd0

Which have been released in v2.7.0 of `aiida-core`. Hence, the test is no longer
correct/necessary, and is removed here.
@mbercx mbercx changed the title ♻️ Fix empty_config context manager ♻️ Fix tests Jul 1, 2025
@mbercx mbercx requested a review from edan-bainglass July 1, 2025 00:23
Copy link
Copy Markdown
Member

@edan-bainglass edan-bainglass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines -35 to -40
def test_constructor_invalid():
"""Test the constructor for invalid arguments."""
with pytest.raises(TypeError, match='missing 1 required positional argument'):
PseudoPotentialData()


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer needed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind. You explain it clearly in the commit message 👍

@mbercx mbercx merged commit 251895b into main Jul 1, 2025
13 checks passed
@mbercx mbercx deleted the tests/empty-config branch July 1, 2025 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants