Skip to content

Commit

Permalink
Catch deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
terrorfisch committed Mar 14, 2024
1 parent d311b69 commit e9bdcf5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/backward_compatibility/hardware_test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')))
Expand Down

0 comments on commit e9bdcf5

Please sign in to comment.