Skip to content
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

Update pytest fixtures #166

Open
ElliottKasoar opened this issue Nov 20, 2024 · 1 comment
Open

Update pytest fixtures #166

ElliottKasoar opened this issue Nov 20, 2024 · 1 comment
Labels
testing Unit testing or CI

Comments

@ElliottKasoar
Copy link
Member

Currently used fixtures are deprecated, and will be removed with AiiDA version 3, so we should look into using fixtures from aiida.tools.pytest_fixtures.

Most fixtures have a direct correspondence to aiida.manage.tests.pytest_fixtures, but currently doing this seems to result in the default profile not being set when callling verdi run.

This can be fixed along the lines of

def test_example_md(example_path, aiida_profile, janus_code):
    command = ["verdi", "profile", "set-default", f"{aiida_profile.name}"]
    result = subprocess.run(command, capture_output=True, text=True, check=False)

but it ought to be fixable via the fixtures directly.

@ElliottKasoar ElliottKasoar added the testing Unit testing or CI label Nov 20, 2024
@alinelena
Copy link
Member

just be careful how you split the command, passing it like that can be dangerous if not all things are correctly escaped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Unit testing or CI
Projects
None yet
Development

No branches or pull requests

2 participants