diff --git a/test/integration/component/test_stopped_vm.py b/test/integration/component/test_stopped_vm.py index 2d2ea05e271..8a4c45fa005 100644 --- a/test/integration/component/test_stopped_vm.py +++ b/test/integration/component/test_stopped_vm.py @@ -1884,8 +1884,7 @@ class TestUploadAttachVolume(cloudstackTestCase): 'Stopped', "Check VM state is Running or not" ) - try: + with self.assertRaises(Exception): virtual_machine.attach_volume(self.apiclient, volume) - except Exception as e: - self.fail("Failed to attach the volume: %s" % e) + self.debug("Failed to attach the volume as expected") return