def METHOD_NAME(self):
    class CustomException(Exception):
        pass
    class BadComplexLike:
        def __complex__(self):
            raise CustomException("something went wrong")
    a = self.test_class()
    with self.assertRaises(CustomException):
        a.value = BadComplexLike()