Skip to content

Commit

Permalink
Fixed tests and linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
canismarko committed Jan 11, 2025
1 parent 819edc3 commit c67210f
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 10 deletions.
7 changes: 6 additions & 1 deletion src/haven/devices/detectors/xspress.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
TriggerInfo,
)
from ophyd_async.epics import adcore
from ophyd_async.epics.adcore._utils import ADBaseDataType, convert_ad_dtype_to_np, NDAttributeParam, NDAttributeDataType
from ophyd_async.epics.adcore._utils import (
ADBaseDataType,
NDAttributeDataType,
NDAttributeParam,
convert_ad_dtype_to_np,
)
from ophyd_async.epics.core import epics_signal_rw, epics_signal_x

from .area_detectors import HavenDetector, default_path_provider
Expand Down
3 changes: 2 additions & 1 deletion src/haven/run_engine.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from uuid import uuid4 as uuid
import logging
from uuid import uuid4 as uuid

import databroker
import IPython
Expand All @@ -10,6 +10,7 @@
from bluesky_kafka import Publisher

from haven import load_config

from .catalog import tiled_client
from .exceptions import ComponentNotFound
from .instrument import beamline
Expand Down
7 changes: 6 additions & 1 deletion src/haven/tests/test_preprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@

@pytest.fixture()
def RE():
return run_engine(use_bec=False, connect_databroker=False, connect_tiled=False)
return run_engine(
use_bec=False,
connect_databroker=False,
connect_tiled=False,
connect_kafka=False,
)


@pytest.mark.xfail
Expand Down
18 changes: 15 additions & 3 deletions src/haven/tests/test_run_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,31 @@ def test_subscribers_garbage_collection(monkeypatch, aps):
"""
monkeypatch.setattr(databroker, "catalog", {"bluesky": databroker.temp()})
RE = run_engine(use_bec=False, connect_tiled=False)
RE = run_engine(
use_bec=False, connect_tiled=False, connect_databroker=True, connect_kafka=False
)
assert len(RE.dispatcher.cb_registry.callbacks) == 12
gc.collect()
assert len(RE.dispatcher.cb_registry.callbacks) == 12


def test_run_engine_preprocessors(aps):
RE = run_engine(use_bec=False, connect_databroker=False, connect_tiled=False)
RE = run_engine(
use_bec=False,
connect_databroker=False,
connect_tiled=False,
connect_kafka=False,
)
assert len(RE.preprocessors) > 0


def test_run_engine_created(aps):
RE = run_engine(use_bec=False, connect_databroker=False, connect_tiled=False)
RE = run_engine(
use_bec=False,
connect_databroker=False,
connect_tiled=False,
connect_kafka=False,
)
assert isinstance(RE, RunEngine)


Expand Down
3 changes: 3 additions & 0 deletions src/queueserver/launch_queueserver.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import logging
import os
import subprocess
from pathlib import Path

from haven import load_config

log = logging.getLogger(__name__)


def launch_queueserver():
# Derive environmental variables
Expand Down
5 changes: 1 addition & 4 deletions src/queueserver/queueserver_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@

# Create a run engine
RE = run_engine(
connect_databroker=False,
connect_tiled=False,
connect_kafka=True,
use_bec=False
connect_databroker=False, connect_tiled=False, connect_kafka=True, use_bec=False
)

# Import devices
Expand Down

0 comments on commit c67210f

Please sign in to comment.