Skip to content

Commit

Permalink
Simplify initial tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Oct 11, 2023
1 parent 3c4f7f4 commit e10f810
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
21 changes: 3 additions & 18 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import docker
import pytest

from jobflow_remote.jobs.daemon import DaemonManager


def _get_free_port():
sock = socket.socket()
Expand Down Expand Up @@ -224,21 +222,8 @@ def daemon_manager():
yield DaemonManager()


@pytest.fixture(scope="function")
@pytest.fixture(scope="session")
def runner(daemon_manager):
yield daemon_manager.start()
daemon_manager.stop()


@pytest.fixture(scope="function")
def new_runner():
"""This fixture yields the start function of a runner,
not the running runner itself, so it can be used to
start multiple runners in parallel.
"""
dm = DaemonManager()
yield dm.start
try:
dm.stop()
except Exception:
pass
yield daemon_manager.start(raise_on_error=True)
daemon_manager.stop(raise_on_error=True)
4 changes: 1 addition & 3 deletions tests/integration/test_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ def test_submit_flow(runner):
submit_flow(flow)


def test_submit_flow_with_dependencies(new_runner):
def test_submit_flow_with_dependencies(runner):
from jobflow import Flow

from jobflow_remote import submit_flow
from jobflow_remote.testing import add

[new_runner() for _ in range(4)]

add_parent_1 = add(1, 1)
add_parent_2 = add(2, 2)
add_children = add(add_parent_1.output, add_parent_2.output)
Expand Down

0 comments on commit e10f810

Please sign in to comment.