Skip to content

Commit

Permalink
Fixed syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
abbiemery committed May 23, 2024
1 parent bbe5f04 commit ff74d2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/ophyd_async/plan_stubs/fly.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ def time_resolved_fly_and_collect_with_static_seq_table(
stages/unstages the devices, and opens and closes the run.
"""
# Ensure there is at least on detector
if len(detectors) == 0:
raise ValueError
if not detectors:
raise ValueError("No detectors provided. There must be at least one.")

# Set up scan and prepare trigger
deadtime = max(det.controller.get_deadtime(exposure) for det in detectors)
Expand Down
5 changes: 4 additions & 1 deletion tests/plan_stubs/test_fly.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ async def test_at_least_one_detector_in_fly_plan(
exposure = 1
shutter_time = 0.004

assert not detector_list

def fly():
yield from time_resolved_fly_and_collect_with_static_seq_table(
stream_name="stream1",
Expand All @@ -369,5 +371,6 @@ def fly():
shutter_time=shutter_time,
)

with pytest.raises(ValueError):
with pytest.raises(ValueError) as exc:
RE(fly())
assert(str(exc)=="No detectors provided. There must be at least one.")

0 comments on commit ff74d2b

Please sign in to comment.