diff --git a/tangostationcontrol/tangostationcontrol/test/clients/test_attr_wrapper.py b/tangostationcontrol/tangostationcontrol/test/clients/test_attr_wrapper.py index eb8fafb1e0e8e7b76f1dd0b416bfaddaa2de2ab5..da2130deb488c4edf7dd625699c58aa03326c35f 100644 --- a/tangostationcontrol/tangostationcontrol/test/clients/test_attr_wrapper.py +++ b/tangostationcontrol/tangostationcontrol/test/clients/test_attr_wrapper.py @@ -43,10 +43,7 @@ class TestAttributeTypes(base.TestCase): def setUp(self): # Avoid the device trying to access itself as a client self.deviceproxy_patch = mock.patch.object(tangostationcontrol.devices.lofar_device,'DeviceProxy') - self.deviceproxy_patch.start() - - def tearDown(self): - self.deviceproxy_patch.stop() + self.addCleanup(self.deviceproxy_patch.stop) class str_scalar_device(lofar_device): scalar_R = attribute_wrapper(comms_annotation="str_scalar_R", datatype=numpy.str)