diff --git a/qupulse/pulses/multi_channel_pulse_template.py b/qupulse/pulses/multi_channel_pulse_template.py index ca3f0140..b6c220b0 100644 --- a/qupulse/pulses/multi_channel_pulse_template.py +++ b/qupulse/pulses/multi_channel_pulse_template.py @@ -58,6 +58,7 @@ def __init__(self, if duration in (True, False): warnings.warn("Boolean duration is deprecated since qupulse 0.6 and interpreted as None", category=DeprecationWarning, stacklevel=2) + duration = None for subtemplate in self._subtemplates: if isinstance(subtemplate, AtomicPulseTemplate): diff --git a/tests/pulses/multi_channel_pulse_template_tests.py b/tests/pulses/multi_channel_pulse_template_tests.py index d76b9ee5..89e2b782 100644 --- a/tests/pulses/multi_channel_pulse_template_tests.py +++ b/tests/pulses/multi_channel_pulse_template_tests.py @@ -68,8 +68,6 @@ def test_non_atomic_subtemplates(self): with self.assertRaises(TypeError): AtomicMultiChannelPulseTemplate((non_atomic_pt, {'A': 'C'}), atomic_pt) - @unittest.skip("This test is skipped because the init check was removed. We keep the code around here because there" - " are plans to introduce a runtime warning instead which could be tested with a few modifications.") def test_instantiation_duration_check(self): subtemplates = [DummyPulseTemplate(parameter_names={'p1'}, measurement_names={'m1'}, @@ -87,10 +85,11 @@ def test_instantiation_duration_check(self): duration='t_3', waveform=DummyWaveform(duration=4, defined_channels={'c3'}))] - with self.assertRaisesRegex(ValueError, 'duration equality'): - AtomicMultiChannelPulseTemplate(*subtemplates) + # with self.assertRaisesRegex(ValueError, 'duration equality'): + # AtomicMultiChannelPulseTemplate(*subtemplates) - amcpt = AtomicMultiChannelPulseTemplate(*subtemplates, duration=True) + with self.assertWarns(DeprecationWarning): + amcpt = AtomicMultiChannelPulseTemplate(*subtemplates, duration=True) self.assertIs(amcpt.duration, subtemplates[0].duration) with self.assertRaisesRegex(ValueError, 'duration'):