Commit 8b3ff773 authored by Sebastien Petitdemange's avatar Sebastien Petitdemange

Merge branch '788-bad-moving-stat' into 'master'

axis.py: added missing 'capture' for exception possibly raised when reading...

Closes #788

See merge request !1353
parents 07a4a8bf 76692a69
Pipeline #11701 canceled with stages
......@@ -272,7 +272,8 @@ class GroupMove:
if state is None:
state = AxisState("FAULT")
# update state and update dial pos.
motion.axis._update_settings(state)
with capture():
motion.axis._update_settings(state)
# update set position if motor has been stopped,
# or if an exception happened or if motion type is
......
......@@ -78,3 +78,18 @@ def test_stop_failure(bad_motor):
bad_motor.stop()
assert "READY" in bad_motor.state
def test_state_after_bad_move(bad_motor):
# related to issue #788
try:
g = gevent.spawn_later(0.1, setattr, bad_motor.controller, "bad_position", True)
with pytest.raises(RuntimeError):
bad_motor.move(1)
g.get()
finally:
# make sure there is no dangling greenlet
g.kill()
assert "FAULT" in bad_motor.state
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment