Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import aiida_dftk.calculations

pytest_plugins = 'aiida.manage.tests.pytest_fixtures'
pytest_plugins = 'aiida.tools.pytest_fixtures'

_LOGGER = logging.getLogger(__name__)
_julia_project_path = Path(__file__).parent / "julia_environment"
Expand All @@ -28,14 +28,14 @@ def pytest_sessionstart():


@pytest.fixture
def get_dftk_code(aiida_local_code_factory):
def get_dftk_code(aiida_code_installed):
"""Return an ``InstalledCode`` instance configured to run DFTK calculations on localhost."""

def _get_code():
return aiida_local_code_factory(
'dftk',
'julia',
return aiida_code_installed(
label='dftk',
default_calc_job_plugin='dftk',
filepath_executable='julia',
prepend_text=f"""\
export JULIA_PROJECT="{_julia_project_path}"
""",
Expand Down Expand Up @@ -117,6 +117,15 @@ def _load_psp(element: str):
return _load_psp


# Override the default aiida_profile fixture to use a rabbitmq profile
# so we can submit workchains and wait for them to complete.
# Not ideal but whatever...
@pytest.fixture(scope="session", autouse=True)
def aiida_profile(aiida_config, aiida_profile_factory):
with aiida_profile_factory(aiida_config, broker_backend="core.rabbitmq") as profile:
yield profile


# TODO: Something like this should exist in aiida! We shouldn't have to do it ourselves just to capture why the test failed.
@pytest.fixture
def submit_and_await_success(submit_and_await):
Expand Down
Loading