From 0c666140d75499d0ae9267cd3f316056c42b311f Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Wed, 25 Jun 2025 11:22:11 +0100 Subject: [PATCH 1/5] skip chipir opi check --- tests/synoptic_tests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/synoptic_tests.py b/tests/synoptic_tests.py index fec9019..0b3b83d 100644 --- a/tests/synoptic_tests.py +++ b/tests/synoptic_tests.py @@ -28,6 +28,8 @@ def setUp(self): @skip_on_instruments( ["DEMO"], "Demo often has a development version installed; this test is not useful" + ["CHIPIR"], "Filter set OPI patched on after migration. Remove this skip if CHIPIR on > V15.0.0" + ) def test_GIVEN_synoptic_THEN_targets_that_it_defines_appear_in_opi_info(self): allowed_targets = self.gui_utils.get_valid_targets(self.gui_utils.get_opi_info_xml()) From ea1d41de9e5efabab5028bcd5ec4b184783d13be Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Wed, 25 Jun 2025 11:31:41 +0100 Subject: [PATCH 2/5] ruff --- tests/synoptic_tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/synoptic_tests.py b/tests/synoptic_tests.py index 0b3b83d..707787f 100644 --- a/tests/synoptic_tests.py +++ b/tests/synoptic_tests.py @@ -8,7 +8,7 @@ class SynopticTests(unittest.TestCase): - def __init__(self, methodName, synoptic=None): + def __init__(self, methodName, synoptic=None): # noqa: N803 # Boilerplate so that unittest knows how to run these tests. super(SynopticTests, self).__init__(methodName) @@ -27,9 +27,9 @@ def setUp(self): self.skipTest("Can't determine which version of the GUI is being used.") @skip_on_instruments( - ["DEMO"], "Demo often has a development version installed; this test is not useful" - ["CHIPIR"], "Filter set OPI patched on after migration. Remove this skip if CHIPIR on > V15.0.0" - + ["DEMO"], + "Demo often has a development version installed; this test is not useful"["CHIPIR"], + "Filter set OPI patched on after migration. Remove this skip if CHIPIR on > V15.0.0", ) def test_GIVEN_synoptic_THEN_targets_that_it_defines_appear_in_opi_info(self): allowed_targets = self.gui_utils.get_valid_targets(self.gui_utils.get_opi_info_xml()) From 4f948383b770be1a05445b56cf56c910fcc0765c Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Wed, 25 Jun 2025 11:34:04 +0100 Subject: [PATCH 3/5] pyright ignore --- tests/synoptic_tests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/synoptic_tests.py b/tests/synoptic_tests.py index 707787f..17432b1 100644 --- a/tests/synoptic_tests.py +++ b/tests/synoptic_tests.py @@ -1,3 +1,4 @@ +# type: ignore import unittest from tests.settings import Settings From 1c71fa5adff1f315db8f5e1bbd0a459bfc5e0f7e Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Mon, 30 Jun 2025 11:09:55 +0100 Subject: [PATCH 4/5] use actual python syntax --- tests/synoptic_tests.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/synoptic_tests.py b/tests/synoptic_tests.py index 17432b1..0322f0e 100644 --- a/tests/synoptic_tests.py +++ b/tests/synoptic_tests.py @@ -1,4 +1,3 @@ -# type: ignore import unittest from tests.settings import Settings @@ -29,7 +28,10 @@ def setUp(self): @skip_on_instruments( ["DEMO"], - "Demo often has a development version installed; this test is not useful"["CHIPIR"], + "Demo often has a development version installed; this test is not useful", + ) + @skip_on_instruments( + ["CHIPIR"], "Filter set OPI patched on after migration. Remove this skip if CHIPIR on > V15.0.0", ) def test_GIVEN_synoptic_THEN_targets_that_it_defines_appear_in_opi_info(self): @@ -37,7 +39,7 @@ def test_GIVEN_synoptic_THEN_targets_that_it_defines_appear_in_opi_info(self): try: type_target_pairs = self.synoptic_utils.get_type_target_pairs( - self.synoptic_utils.get_xml(self.synoptic) + self.synoptic_utils.get_xml(self.synoptic) # type: ignore ) except Exception as e: self.fail( @@ -82,7 +84,7 @@ def test_GIVEN_synoptic_THEN_types_that_it_defines_appear_in_opi_info(self): try: type_target_pairs = self.synoptic_utils.get_type_target_pairs( - self.synoptic_utils.get_xml(self.synoptic) + self.synoptic_utils.get_xml(self.synoptic) # type: ignore ) except Exception as e: self.fail( @@ -101,7 +103,7 @@ def test_GIVEN_synoptic_THEN_types_that_it_defines_appear_in_opi_info(self): def test_GIVEN_synoptic_THEN_pv_addresses_are_not_empty(self): try: - pvs = self.synoptic_utils.get_pv_addresses(self.synoptic_utils.get_xml(self.synoptic)) + pvs = self.synoptic_utils.get_pv_addresses(self.synoptic_utils.get_xml(self.synoptic)) # type: ignore except Exception as e: self.fail( "In synoptic {}, XML failed to parse properly. Error text was: {}".format( From 2505fa4dbe62269257efe8ca06ae7dfbb21cba9b Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Mon, 30 Jun 2025 11:10:58 +0100 Subject: [PATCH 5/5] remove now out of date statements --- tests/synoptic_tests.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/synoptic_tests.py b/tests/synoptic_tests.py index 0322f0e..93d2732 100644 --- a/tests/synoptic_tests.py +++ b/tests/synoptic_tests.py @@ -49,24 +49,6 @@ def test_GIVEN_synoptic_THEN_targets_that_it_defines_appear_in_opi_info(self): ) for type, target in type_target_pairs: - if ( - Settings.name == "RIKENFE" - and self.version_utils.get_version() == "12.0.1" - and ( - target == "RIKEN Vacuum" - or target == "RIKEN Kicker and Separator HV settings" - or target == "RIKEN Magnet PSU" - or target == "RIKEN PSU Status Summary" - ) - ): - continue # This is hotfixed on RIKENFE. This condition can be removed at next release. - if ( - Settings.name == "WISH" - and self.version_utils.get_version() == "12.0.1" - and (target == "Keysight E4980AL" or target == "Razorbill RP100 Strain Cell PSU") - ): - continue # This is hotfixed on WISH. This condition can be removed at next release. - if not self.synoptic_utils.target_should_be_ignored(target): self.assertIn( target,