From e9bdcf590ff24ab662e44a8ee218df3b0731f202 Mon Sep 17 00:00:00 2001 From: Simon Humpohl Date: Thu, 14 Mar 2024 17:17:08 +0100 Subject: [PATCH] Catch deprecation warnings --- tests/backward_compatibility/hardware_test_helper.py | 7 +++++-- ...nst_charge_scan_test.py => zhinst_charge_scan_tests.py} | 0 2 files changed, 5 insertions(+), 2 deletions(-) rename tests/backward_compatibility/{zhinst_charge_scan_test.py => zhinst_charge_scan_tests.py} (100%) diff --git a/tests/backward_compatibility/hardware_test_helper.py b/tests/backward_compatibility/hardware_test_helper.py index 1314283c2..7a1b4da88 100644 --- a/tests/backward_compatibility/hardware_test_helper.py +++ b/tests/backward_compatibility/hardware_test_helper.py @@ -4,6 +4,7 @@ import typing import importlib.util import sys +import warnings from qupulse.serialization import Serializer, FilesystemBackend, PulseStorage from qupulse.pulses.pulse_template import PulseTemplate @@ -54,8 +55,10 @@ def load_function_from_file(self, file_name, function_name): return getattr(module, function_name, None) def deserialize_pulse(self): - serializer = Serializer(FilesystemBackend(os.path.join(self.data_folder, 'pulse_storage'))) - self.pulse = typing.cast(PulseTemplate, serializer.deserialize(self.pulse_name)) + with warnings.catch_warnings(): + warnings.simplefilter('ignore', category=DeprecationWarning) + serializer = Serializer(FilesystemBackend(os.path.join(self.data_folder, 'pulse_storage'))) + self.pulse = typing.cast(PulseTemplate, serializer.deserialize(self.pulse_name)) def deserialize_pulse_2018(self) -> None: pulse_storage = PulseStorage(FilesystemBackend(os.path.join(self.data_folder, 'pulse_storage_converted_2018'))) diff --git a/tests/backward_compatibility/zhinst_charge_scan_test.py b/tests/backward_compatibility/zhinst_charge_scan_tests.py similarity index 100% rename from tests/backward_compatibility/zhinst_charge_scan_test.py rename to tests/backward_compatibility/zhinst_charge_scan_tests.py