Skip to content

Commit

Permalink
installed code
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas committed May 15, 2024
1 parent 7bce556 commit 2f1f9d4
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
@pytest.fixture
def fixture_localhost(aiida_localhost):
"""Return a localhost `Computer`."""
localhost = aiida_localhost
localhost.set_default_mpiprocs_per_machine(1)
return localhost
aiida_localhost.set_default_mpiprocs_per_machine(1)
return aiida_localhost


@pytest.fixture
Expand Down Expand Up @@ -157,30 +156,30 @@ def _generate_calc_job_node(


@pytest.fixture
def multiply_add_completed_workchain(aiida_local_code_bash):
def multiply_add_completed_workchain(aiida_code_bash):
"""Return a `MultiplyAddWorkChain` instance with a `finished` process state and exit status of 0."""
from aiida.workflows.arithmetic.multiply_add import MultiplyAddWorkChain

inputs = {
"x": orm.Int(1),
"y": orm.Int(2),
"z": orm.Int(3),
"code": aiida_local_code_bash,
"code": aiida_code_bash,
}
_, process = engine.run_get_node(MultiplyAddWorkChain, **inputs)
return process


@pytest.fixture
def multiply_add_process_builder_ready(aiida_local_code_bash):
def multiply_add_process_builder_ready(aiida_code_bash):
"""Return a `MultiplyAddWorkChain` builder with all inputs set."""
from aiida.workflows.arithmetic.multiply_add import MultiplyAddWorkChain

builder = MultiplyAddWorkChain.get_builder()
builder.x = orm.Int(1)
builder.y = orm.Int(2)
builder.z = orm.Int(3)
builder.code = aiida_local_code_bash
builder.code = aiida_code_bash
return builder


Expand Down Expand Up @@ -278,9 +277,11 @@ def folder_data_object():


@pytest.fixture
def aiida_local_code_bash(aiida_local_code_factory):
def aiida_code_bash(aiida_code_installed):
"""Return a `Code` configured for the bash executable."""
return aiida_local_code_factory(executable="bash", entry_point="bash")
return aiida_code_installed(
filepath_executable="/bin/bash", default_calcjob_plugin="bash"
)


@pytest.fixture
Expand Down

0 comments on commit 2f1f9d4

Please sign in to comment.