diff --git a/tests/test_backend.py b/tests/test_backend.py index ff28d0d30..1b12f729e 100644 --- a/tests/test_backend.py +++ b/tests/test_backend.py @@ -134,8 +134,8 @@ def create_noise_model(param, value): } ) with pytest.warns( - DeprecationWarning, - match=f"{param} is deprecated.", + (UserWarning, DeprecationWarning), + match=f"{param}", ): return NoiseModel(**{param: value}) return NoiseModel(**{param: value}) @@ -213,7 +213,7 @@ def test_eff_noise_probs(self, matrices): eff_noise_rates=[-1.0, 0.5], ) with pytest.warns( - DeprecationWarning, match="eff_noise_probs is deprecated." + (UserWarning, DeprecationWarning), match="eff_noise_probs" ): NoiseModel( noise_types=("eff_noise",), diff --git a/tests/test_sequence.py b/tests/test_sequence.py index 6e25b3465..a228072cc 100644 --- a/tests/test_sequence.py +++ b/tests/test_sequence.py @@ -595,27 +595,26 @@ def test_switch_device_down( ValueError, match="No match for channel raman_1 with the" " same clock_period.", ): - with pytest.warns(DeprecationWarning, match="From v0.17"): - # Can't find a match for the 2nd rydberg_local - seq.switch_device( - dataclasses.replace( - phys_Chadoq2, - channel_objects=( - DigitalAnalogDevice.channels["rydberg_global"], - dataclasses.replace( - DigitalAnalogDevice.channels["raman_local"], - clock_period=10, - ), + # Can't find a match for the 2nd rydberg_local + seq.switch_device( + dataclasses.replace( + phys_Chadoq2, + channel_objects=( + DigitalAnalogDevice.channels["rydberg_global"], + dataclasses.replace( DigitalAnalogDevice.channels["raman_local"], + clock_period=10, ), - channel_ids=( - "rydberg_global", - "rydberg_local", - "rydberg_local1", - ), + DigitalAnalogDevice.channels["raman_local"], ), - strict=True, - ) + channel_ids=( + "rydberg_global", + "rydberg_local", + "rydberg_local1", + ), + ), + strict=True, + ) # From sequence reusing DMMs to Device without reusable channels seq = init_seq( diff --git a/tests/test_simulation.py b/tests/test_simulation.py index 6646374d0..5839232c3 100644 --- a/tests/test_simulation.py +++ b/tests/test_simulation.py @@ -954,7 +954,7 @@ def test_noisy_xy(): with pytest.raises( NotImplementedError, match="mode 'XY' does not support simulation of" ): - with pytest.warns(DeprecationWarning, match="is_deprecated"): + with pytest.warns(DeprecationWarning, match="is deprecated"): sim._hamiltonian.set_config( SimConfig(("SPAM", "doppler")).to_noise_model() )