Commit 76692a69 authored by Matias Guijarro's avatar Matias Guijarro

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

axis.py: added missing 'capture' for exception possibly raised when reading position in case of bad motor state reading
parent 07a4a8bf
Pipeline #11532 passed with stages
in 35 minutes and 42 seconds
......@@ -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