From 4d33c1a651b3e023ce0df006b30e685fa410872f Mon Sep 17 00:00:00 2001 From: Marco Rocchietti Date: Tue, 13 Aug 2024 12:57:13 -0300 Subject: [PATCH 1/2] Change the exception raised by ``MTCS.run_m2_actuator_bump_test`` to ``RuntimeError`` and update the corresponding unit test. --- python/lsst/ts/observatory/control/maintel/mtcs.py | 2 +- tests/maintel/test_mtcs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/lsst/ts/observatory/control/maintel/mtcs.py b/python/lsst/ts/observatory/control/maintel/mtcs.py index d4455a96..90b71733 100644 --- a/python/lsst/ts/observatory/control/maintel/mtcs.py +++ b/python/lsst/ts/observatory/control/maintel/mtcs.py @@ -1477,7 +1477,7 @@ async def run_m2_actuator_bump_test( # csc actuator id is 0 based and hardpoint id is 1 based if actuator + 1 in hardpoint_ids: - raise Exception( + raise RuntimeError( f"Cannot bump test one of the M2 hardpoints: actuator = {actuator}." ) diff --git a/tests/maintel/test_mtcs.py b/tests/maintel/test_mtcs.py index df692d13..704f2007 100644 --- a/tests/maintel/test_mtcs.py +++ b/tests/maintel/test_mtcs.py @@ -1595,7 +1595,7 @@ async def test_run_m2_actuator_bump_test_hardpoint(self) -> None: period = 60 force = 10 - with pytest.raises(Exception): + with pytest.raises(RuntimeError): await self.mtcs.run_m2_actuator_bump_test( actuator=actuator, period=period, From ee040f4073f8013f5ffc8f241d318fcfa1c5d6ff Mon Sep 17 00:00:00 2001 From: Marco Rocchietti Date: Tue, 13 Aug 2024 15:02:24 -0300 Subject: [PATCH 2/2] Add news fragments. --- doc/news/DM-41601.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/news/DM-41601.bugfix.rst diff --git a/doc/news/DM-41601.bugfix.rst b/doc/news/DM-41601.bugfix.rst new file mode 100644 index 00000000..4cab2842 --- /dev/null +++ b/doc/news/DM-41601.bugfix.rst @@ -0,0 +1 @@ +Change the exception raised by ``MTCS.run_m2_actuator_bump_test`` to ``RuntimeError`` and update the corresponding unit test.